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

Fix: Add support for streaming data to mixins.apply_descrambler #568

Merged
merged 2 commits into from
Feb 20, 2020

Conversation

krapes
Copy link

@krapes krapes commented Feb 17, 2020

This pull request merges a couple of fixes to the mixins.apply_descrambler. Specifically those from @giacaglia here and @FidoDidoVN here

It also adds a try - except case for videos that were failing because they didn't have a 'formats' in the stream_data json

giacaglia and others added 2 commits December 23, 2019 14:55
Add a try and except to handle cases where the stream_data json does not contain stream_data['player_response'])['streamingData']['formats']
@krapes krapes requested a review from nficano February 17, 2020 23:35
@Armster15
Copy link

Armster15 commented Feb 19, 2020

Following pull request breaks the length and thumbnail_url attributes

Sorry don't know where to post this issue but the following pull request, although it fixes mixins.apply_descrambler, it breaks the thumbnail_url attribute of the YouTube class and the length attribute. The following error logs are pretty much the same.


Error log for thumbnail_url:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python36\lib\site-packages\pytube\__main__.py", line 258, in thumbnail_url
    return self.player_config_args['thumbnail_url']
KeyError: 'thumbnail_url'

Error log for length:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python36\lib\site-packages\pytube\__main__.py", line 299, in length
    return self.player_config_args['length_seconds']
KeyError: 'length_seconds'

@krapes
Copy link
Author

krapes commented Feb 19, 2020

Hey, thanks for the update. Can you post the code you were trying to run when you got those errors?

@hbmartin
Copy link
Contributor

@krapes @armaan115 you can pull in fixes from pytube3 for these issues

@Armster15
Copy link

LOL I just fixed the error as well, you guys can pull in the fixes: https://github.com/armaan115/pytube-568.git

@nficano nficano merged commit f176ecd into pytube:master Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants