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

Wrong YouTube channel downloaded when grabbing geoblocked channel #10009

Closed
ivan opened this issue Jul 5, 2016 · 4 comments
Closed

Wrong YouTube channel downloaded when grabbing geoblocked channel #10009

ivan opened this issue Jul 5, 2016 · 4 comments
Labels
bug

Comments

@ivan
Copy link
Contributor

@ivan ivan commented Jul 5, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.07.05. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.07.05

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

# PYTHONPATH=. python3 -m youtube_dl -v 'https://www.youtube.com/user/kananishinoSMEJ/videos'
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/user/kananishinoSMEJ/videos']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.07.05
[debug] Git HEAD: 4080530
[debug] Python version 3.5.1+ - Linux-4.4.8-std-1-armv7l-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 2.8.6-1ubuntu2, ffprobe 2.8.6-1ubuntu2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube:user] kananishinoSMEJ: Downloading channel page
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading webpage
[download] Downloading playlist: Uploads from SQUEEZIE
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading page #1
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading page #2
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading page #3
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading page #4
^C
ERROR: Interrupted by user
# PYTHONPATH=. python3 -m youtube_dl -v 'https://www.youtube.com/user/kananishinoSMEJ'       
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/user/kananishinoSMEJ']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.07.05
[debug] Git HEAD: 4080530
[debug] Python version 3.5.1+ - Linux-4.4.8-std-1-armv7l-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 2.8.6-1ubuntu2, ffprobe 2.8.6-1ubuntu2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube:user] kananishinoSMEJ: Downloading channel page
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading webpage
[download] Downloading playlist: Uploads from SQUEEZIE
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading page #1
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading page #2
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading page #3
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading page #4
[youtube:playlist] UUWeg2Pkate69NFdBeuRFTAw: Downloading page #5
^C
ERROR: Interrupted by user

Description of your issue, suggested solution and other information

Some YouTube channels are fully geoblocked, e.g. https://www.youtube.com/user/kananishinoSMEJ is accessible only from Japanese IP blocks. Downloading that channel with youtube-dl outside of Japan results in youtube-dl grabbing an unrelated channel.

Possibly related to #5904

@yan12125 yan12125 added the bug label Jul 5, 2016
@ivan
Copy link
Contributor Author

@ivan ivan commented Jul 5, 2016

It looks like

            channel_playlist_id = self._html_search_meta(
                'channelId', channel_page, 'channel id', default=None)

fails to find anything and it falls back to

            if not channel_playlist_id:
                channel_playlist_id = self._search_regex(
                    r'data-(?:channel-external-|yt)id="([^"]+)"',
                    channel_page, 'channel id', default=None)

and extracts an unrelated channel ID.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 5, 2016

Yep. It finds channels under the section "Related channels"

@ivan
Copy link
Contributor Author

@ivan ivan commented Jul 5, 2016

I have an even-more-paranoid version of a fix that involves extracting both <meta itemprop="channelId" and <link rel="alternate" type="application/rss+xml" title="RSS" href="https://www.youtube.com/feeds/videos.xml?channel_id= and making sure they match, would you take a PR with that?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 5, 2016

Haven't investigated. The fallback part is exactly a fix for #5904. Maybe @dstftw knows more for why not use the video.xml approach.

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