Skip to content
This repository has been archived by the owner on Oct 25, 2020. It is now read-only.

Fixed search for itags and urls according to YouTube API Pattern #41

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

dpserretti
Copy link

Fixed search for itags and urls according to new YouTube API Pattern

Copy link
Owner

@cdown cdown left a comment

Choose a reason for hiding this comment

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

Thanks, please see comments.

"Live and streaming videos are unsupported."
) from None
try:
import json
Copy link
Owner

Choose a reason for hiding this comment

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

Don't import inline, do it with the others.

@@ -11,7 +11,7 @@

setup(
name="yturl",
version="2.0.2",
version="2.0.3",
Copy link
Owner

Choose a reason for hiding this comment

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

We don't bump the version until the release tests pass, which are not run here. Please remove this. :-)

try:
import json
return collections.OrderedDict([(i['itag'], i['url']) for i in
json.loads(api_response['player_response'])['streamingData'][
Copy link
Owner

Choose a reason for hiding this comment

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

I'm pretty sure this isn't black formatted, so CI won't be happy :-)

return collections.OrderedDict([(i['itag'], i['url']) for i in
json.loads(api_response['player_response'])['streamingData'][
'formats']])
except:
Copy link
Owner

Choose a reason for hiding this comment

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

Don't use bare except, check the exceptions you actually care about. For example, this will even catch keyboard interrupts...

@sskras
Copy link

sskras commented May 9, 2020

@dpserretti, are you going to adjust the patch?

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

Successfully merging this pull request may close these issues.

None yet

3 participants