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

[peertube] Extract files also from streamingPlaylists #26302

Closed
wants to merge 1 commit into from

Conversation

0l-l0
Copy link

@0l-l0 0l-l0 commented Aug 11, 2020

As mentioned in #26002 some PeerTube instances respond with a seemingly corrupted video descriptor JSON object and the extractor is unable to determine the available file formats in those cases. Turned out that an empty "files" array caused those kind of problems but, fortunately, there are another "files" arrays in "streamingPlaylists" array which can be used instead.

Here is the corresponding part of the API specification:
https://docs.joinpeertube.org/api-rest-reference.html#tag/Video/paths/~1videos~1%7Bid%7D/get

JSON objects with an empty "files" tag seem to be a valid PeerTube API
response. In those cases the "files" arrays contained in the
"streamingPlaylists" members can be used instead.
@tpikonen
Copy link

tpikonen commented Oct 3, 2020

This PR indeed fixes #26002. Please merge.

Comment on lines +541 to +542
files = video['files']
for playlist in video['streamingPlaylists']:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
files = video['files']
for playlist in video['streamingPlaylists']:
files = video.get('files') or []
for playlist in (video.get('streamingPlaylists') or []):

Copy link
Author

Choose a reason for hiding this comment

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

Corrections in #27728

@0l-l0
Copy link
Author

0l-l0 commented Jan 8, 2021

I made an another PR (#27728) because my original repo disappeared after the DMCA take-down.

@0l-l0 0l-l0 closed this Jan 8, 2021
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.

3 participants