-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tele5] Fix extractor #22686
[tele5] Fix extractor #22686
Conversation
youtube_dl/extractor/nexx.py
Outdated
general = video['general'] | ||
title = general['title'] | ||
# some videos have 'bumpers' (ads), the API returns a list in that case | ||
if type(video_json) == list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isinstance
.
youtube_dl/extractor/nexx.py
Outdated
if type(video_json) == list: | ||
for v in video_json: | ||
general_info = v['general'] | ||
if str(general_info['ID']) == video_id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compat_str
.
youtube_dl/extractor/nexx.py
Outdated
# the bumpers have differing IDs | ||
video = v | ||
general = general_info | ||
title = general['title'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you're suggesting here, but I incorporated your other suggestions.
youtube_dl/extractor/nexx.py
Outdated
# the bumpers have differing IDs | ||
video = v | ||
general = general_info | ||
title = general['title'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DRY.
youtube_dl/extractor/nexx.py
Outdated
else: | ||
video = video_json | ||
general = video['general'] | ||
title = general['title'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DRY.
youtube_dl/extractor/tele5.py
Outdated
@@ -9,13 +9,14 @@ | |||
class Tele5IE(InfoExtractor): | |||
_VALID_URL = r'https?://(?:www\.)?tele5\.de/(?:[^/]+/)*(?P<id>[^/?#&]+)' | |||
_TESTS = [{ | |||
'url': 'https://www.tele5.de/mediathek/filme-online/videos?vid=1549416', | |||
'url': 'https://www.tele5.de/star-trek/enterprise/ganze-folge/freund-oder-feind/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep test with non-ad rendition.
I successfully used this fixed version to get https://www.tele5.de/digimon/ganze-folge/calumon-wird-befreit/ which did not work with 2019.09.28. https://www.tele5.de/star-trek/enterprise/ganze-folge/freund-oder-feind/ also worked for me with this fix but not with 2019.09.28. Interestingly enough I never encountered a 403 in case of star trek I encountered a 500 and with digimon I encountered a python exception. |
Intresting I keep getting 403 errors for all videos on the tele5 website with FliegendeWurst's version. |
Tele5 now uses JW Player and a partial (?) fix is already done. |
Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
The API returns a list of videos if a 'bumper' (an ad) is supposed to be played before the video. The extractor will now select the video with the originally requested ID. This PR should fix #22666.