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

Youtube Geo "AllowedRegions" No Longer Returned by Extractor Error #26588

Open
ozburo opened this issue Sep 14, 2020 · 0 comments
Open

Youtube Geo "AllowedRegions" No Longer Returned by Extractor Error #26588

ozburo opened this issue Sep 14, 2020 · 0 comments

Comments

@ozburo
Copy link

@ozburo ozburo commented Sep 14, 2020

Checklist

  • I've verified that I'm running youtube-dl version 2020.09.14
  • I'm reporting a broken site support
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-Jv', u'https://www.youtube.com/watch?v=BTc9jwPkCls']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.09.14
[debug] Python version 2.7.16 (CPython) - Darwin-18.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1, rtmpdump 2.4
[debug] Proxy map: {}
ERROR: The uploader has not made this video available in your country.
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
ie_result = ie.extract(url)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
ie_result = self._real_extract(url)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 2231, in _real_extract
raise ExtractorError(error_message, expected=True)
ExtractorError: The uploader has not made this video available in your country.

Description

IIRC the Youtube Extractor used to return a list of countries the Geo-Blocked video is available in. However we are now just getting the generic "The uploader has not made this video available in your country.".

This example video is available in Japan (it's the same url/video used in our tests/issues) but we are not told which country(s) it's available in -- so I can't know which proxy to use -- which is the point of returning the countries list like it used to.

I've read the code and there is a block that checks if the youtube page has a meta tag with "Allowed Regions" that is a simple list of country codes to return. This block and it's subsequent GeoExtractorError are not called, and the generic ExtractorError is returned instead w/o the countries list.

For now I have to open the original Youtube page and inspect the DOM to get the Allowed Regions list but it would be nice if YTDL would return this in the error so I/we don't have to do this.

Again, I'm not sure if this is a regression, the code is there, it's a simple meta tag lookup for the countries list, not sure why it's not being triggered.

I could take a deeper look at this and find a possible fix if you're open to accepting PRs from untrusted sources.

Hopefully this could be resolved soon.

Cheers.

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
1 participant
You can’t perform that action at this time.