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

yahoo.py extractor should support videos outside the United States #3915

Closed
yan12125 opened this issue Oct 10, 2014 · 3 comments
Closed

yahoo.py extractor should support videos outside the United States #3915

yan12125 opened this issue Oct 10, 2014 · 3 comments

Comments

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 10, 2014

I'd like to download the following video clip:
"https://tw.screen.yahoo.com/taipei-opinion-poll/%E9%81%B8%E6%83%85%E7%AB%99%E5%A0%B1-%E8%A1%97%E9%A0%AD%E6%B0%91%E8%AA%BF-%E5%8F%B0%E5%8C%97%E5%B8%82%E7%AF%87-102823042.html"
Short link: http://ppt.cc/3iGP

youtube-dl reports that the site is not supported. However, if I apply the following modifications to youtube_dl/extractor/yahoo.py, the video clip is downloaded fluently.

  1. Change the _VALID_URL regexp
    _VALID_URL = r'(?P<url>https?://(?:screen|movies)\.yahoo\.com/.*?-(?P<id>[0-9]+)(?:-[a-z]+)?\.html)'
    to
    _VALID_URL = r'(?P<url>https?://.*(?:screen|movies)\.yahoo\.com/.*?-(?P<id>[0-9]+)(?:-[a-z]+)?\.html)'
    It's at line 18 of version 2014.10.05.2
  2. Change the query region from US to TW
query = ('SELECT * FROM yahoo.media.video.streams WHERE id="%s"'
         ' AND plrs="86Gj0vCaSzV_Iuf6hNylf2" AND region="US"'
         ' AND protocol="http"' % long_id)

to

query = ('SELECT * FROM yahoo.media.video.streams WHERE id="%s"'
         ' AND plrs="86Gj0vCaSzV_Iuf6hNylf2" AND region="TW"'
         ' AND protocol="http"' % long_id)

They're in line 78~80 of version 2014.10.05.2

If part 2 is not done, YQL returns a "restricted" error.

This is just a quick fix. Further work includes finding a mapping from the URL to the region parameter in YQL.
Issue #2470 is similar to this one, but I think they're different.

@dstftw dstftw closed this in 762958d Oct 10, 2014
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 10, 2014

Thanks, fixed.

@phihag
Copy link
Contributor

@phihag phihag commented Oct 12, 2014

Fixed in youtube-dl 2015.10.12. Type youtube-dl -U to update.

@yan12125
Copy link
Collaborator Author

@yan12125 yan12125 commented Oct 16, 2014

youtube-dl is updated in Archlinux and it works perfectly. Thanks a lot for the excellent work!

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.