Skip to content
This repository was 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
dpserretti wants to merge 2 commits into
cdown:developfrom
dpserretti:develop
Open

Fixed search for itags and urls according to YouTube API Pattern#41
dpserretti wants to merge 2 commits into
cdown:developfrom
dpserretti:develop

Conversation

@dpserretti

Copy link
Copy Markdown

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

@cdown cdown left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks, please see comments.

Comment thread yturl.py
"Live and streaming videos are unsupported."
) from None
try:
import json

Copy link
Copy Markdown
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.

Comment thread setup.py
setup(
name="yturl",
version="2.0.2",
version="2.0.3",

Copy link
Copy Markdown
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. :-)

Comment thread yturl.py
try:
import json
return collections.OrderedDict([(i['itag'], i['url']) for i in
json.loads(api_response['player_response'])['streamingData'][

Copy link
Copy Markdown
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 :-)

Comment thread yturl.py
return collections.OrderedDict([(i['itag'], i['url']) for i in
json.loads(api_response['player_response'])['streamingData'][
'formats']])
except:

Copy link
Copy Markdown
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

sskras commented May 9, 2020

Copy link
Copy Markdown

@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.

3 participants