Skip to content
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

Closed
wants to merge 1 commit into from
Closed

[tele5] Fix extractor #22686

wants to merge 1 commit into from

Conversation

FliegendeWurst
Copy link

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:

  • I am the original author of this code and I am willing to release it under Unlicense

What is the purpose of your pull request?

  • Bug fix

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.

general = video['general']
title = general['title']
# some videos have 'bumpers' (ads), the API returns a list in that case
if type(video_json) == list:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isinstance.

if type(video_json) == list:
for v in video_json:
general_info = v['general']
if str(general_info['ID']) == video_id:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compat_str.

# the bumpers have differing IDs
video = v
general = general_info
title = general['title']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next.

Copy link
Author

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.

# the bumpers have differing IDs
video = v
general = general_info
title = general['title']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY.

else:
video = video_json
general = video['general']
title = general['title']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY.

@@ -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/',
Copy link
Collaborator

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.

@detailedreport
Copy link

detailedreport commented Oct 13, 2019

Thank you for your time and effort, Tele5 changed yet again, your version and the previously latest youtube-dl version now both produce an http-403 error.

This affects every video availabe on Tele5.de, even the Trailers.

1 - Kopie
2 - Kopie

@Centzilius
Copy link

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.

@detailedreport
Copy link

detailedreport commented Oct 14, 2019

Intresting I keep getting 403 errors for all videos on the tele5 website with FliegendeWurst's version.
With 2019.09.28 i get 403s for StarTrek and other Series and Trailers but for Digimon i now get the original "TypeError: list indices must be integers, not str" i originally reported at: #22666

@FliegendeWurst
Copy link
Author

FliegendeWurst commented Apr 11, 2020

Tele5 now uses JW Player and a partial (?) fix is already done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I'm reporting a broken site support for "Tele5" - [UPDATED] October 14th 2019
4 participants