1

IMHO I don't think this question is a duplicate of that one due these reasons:

  1. Let's begin by considering the titles: How can I update youtube-dl?, clearly focuses on a single application/update procedure instead a report of a download failure not focused on only one application.
  2. Tags: This question: video, downloads, youtube. The other: apt, updates, youtube. They only have the youtube tag in common.
  3. The two questions have overlapping topics, but they are not identical questions because the other question's topic is a subset of the topic of this one.

Now let's see more arguments (in parentheses):


I'm trying to download some YouTube videos first by Firefox + Video DownloadHelper, then by VLC and finally by youtube-dl program and there's something that is blocking them.

(The other:"I use youtube-dl to download videos for watching later offline", again this question focuses on download blocking in YouTube regardless of the application and the other, in a single application (youtube-dl) )

On the description screens I don't see any restriction about download.

(This is not mentioned in the other question.)

An example: I'm trying to download 2 videos with same category/license, the first works fine and the second returns an exception:

luis@jupiter:~$ youtube-dl "https://www.youtube.com/watch?v=wo6Sq1h2DI4"
[youtube] wo6Sq1h2DI4: Downloading webpage
[youtube] wo6Sq1h2DI4: Downloading video info webpage
[youtube] wo6Sq1h2DI4: Extracting video information
[youtube] wo6Sq1h2DI4: Downloading MPD manifest
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: SÂNSCRITO - Aula 6 (Consoantes Mudas Dentais) com Jonas Masetti-wo6Sq1h2DI4.f137.mp4
[download] 100% of 142.54MiB in 04:11
[download] Destination: SÂNSCRITO - Aula 6 (Consoantes Mudas Dentais) com Jonas Masetti-wo6Sq1h2DI4.f251.webm
[download] 100% of 8.75MiB in 00:16
[ffmpeg] Merging formats into "SÂNSCRITO - Aula 6 (Consoantes Mudas Dentais) com Jonas Masetti-wo6Sq1h2DI4.mkv"
Deleting original file SÂNSCRITO - Aula 6 (Consoantes Mudas Dentais) com Jonas Masetti-wo6Sq1h2DI4.f137.mp4 (pass -k to keep)
Deleting original file SÂNSCRITO - Aula 6 (Consoantes Mudas Dentais) com Jonas Masetti-wo6Sq1h2DI4.f251.webm (pass -k to keep)
luis@jupiter:~$ youtube-dl "https://www.youtube.com/watch?v=BbbhZl8xqVY"
[youtube] BbbhZl8xqVY: Downloading webpage
[youtube] BbbhZl8xqVY: Downloading video info webpage
[youtube] BbbhZl8xqVY: Extracting video information
[youtube] BbbhZl8xqVY: Downloading js player en_US-vflHuW2fm
ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 905, in _decrypt_signature
    video_id, player_url, s
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 820, in _extract_signature_function
    res = self._parse_sig_js(code)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 883, in _parse_sig_js
    initial_function = jsi.extract_function(funcname)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/jsinterp.py", line 241, in extract_function
    raise ExtractorError('Could not find JS function %r' % funcname)
ExtractorError: Could not find JS function u'Ny'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
 (caused by ExtractorError(u"Could not find JS function u'Ny'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.",)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Is it a YouTube restriction, a video encoding issue or an Ubuntu signature problem? If this is a YouTube restriction, is this a restriction for all YouTube videos or does the restriction operate selectively, for example for newly uploaded videos, but not for videos that were uploaded years ago?

The output of the other question:

ERROR: Unable to extract info section; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.

(The output's a little bit different, isn't it?)


Finally there are two more issues to be considered:

  • Although the upgrade of youtube-dl has helped me to solve my problem, it didn't answer this item of my question: I'm trying to download 2 videos with same category/license, the first works fine and the second returns an exception.
  • The other question was written in 2013, and I believe that since then some things have changed in YouTube service and applications' way of accessing it.
gwarah
  • 273
  • 1
    Works ok with the latest youtube-dl. Try this solution: http://askubuntu.com/a/806592/57576 – andrew.46 Aug 07 '16 at 19:26
  • Ok @andrew.46, thanks, I'm gonna try it. But do you know why these download blockings? Youtube or ubuntu restrictions, or both? The videos I've posts have same license/category. – gwarah Aug 07 '16 at 19:32
  • I have not tested with the Download Helper or vlc but with youtube-dl there is no restriction, at least from here :). Pastebin for the second download here: http://pastebin.com/MZA3X39E – andrew.46 Aug 07 '16 at 19:47
  • 1
    Works fine @andrew.46, tks a lot! – gwarah Aug 07 '16 at 19:53
  • That is excellent news! Enjoy your video and have a great day :) – andrew.46 Aug 07 '16 at 20:01
  • 2
  • Similar but not exacly duplicate in my opinion. This question issues about more items not issued on that other. youtube-dl update help me too much but not answered completelly the question. – gwarah Aug 08 '16 at 09:28
  • @andrew.46, do you intend to write an answer with these solution you suggest me? – gwarah Aug 10 '16 at 14:23
  • @gwarah OK I have created an answer with a few more details to make it different from my other one... – andrew.46 Aug 10 '16 at 20:14
  • Ok @andrew.46, by the way your answer also brings an important information: YouTube Terms of Service and restriction of downloads by other players than the default video. Thanks again for the contribution. Now, you and Karel will wait for my choice of the best answer. ;) – gwarah Aug 10 '16 at 20:39
  • @gwarah Perhaps download this one: https://www.youtube.com/watch?v=wsbgwNe4Rv4 :) – andrew.46 Aug 10 '16 at 20:58
  • @gwarah The 'Close' votes have vanished, you might be able to clean out your question's comments directed at the Close voters now? – andrew.46 Aug 19 '16 at 10:28
  • Hi @andrew.46, sure. Two answers and two important contributions in solve the download video, getting more information about the issue discussed and proving it's not a duplicate question. Depending on me I would choose both as best answers. Choose the Karel's one because he additionally help me too much on correct and clarify my question. Tks for everyone who take part. Namaste! – gwarah Aug 19 '16 at 15:45

2 Answers2

5

The first video downloaded successfully with a recently updated version of youtube-dl which I installed with python-pip using python pip install youtube-dl inside a Python virtual environment (python-virtualenv). For information about how to setup and use a Python virtual environment see How to set up and use a virtual python environment in Ubuntu?.

The command I used to show the available video formats was:

youtube-dl -F "https://www.youtube.com/watch?v=wo6Sq1h2DI4"

The command I used to download the first YouTube video was:

youtube-dl -f 18 "https://www.youtube.com/watch?v=wo6Sq1h2DI4"

The second video could not be downloaded using youtube-dl, but I did not give up. I upgraded my youtube-dl to the latest version by running:

pip install --upgrade youtube-dl  # inside the Python virtual environment

I didn't need to use sudo because my Python virtual environment was installed inside my own user directory (~/my-Python-virtual-env). After upgrading youtube-dl I ran this command to download the second YouTube video:

youtube-dl -f 18 "https://www.youtube.com/watch?v=BbbhZl8xqVY"

Why not simply use sudo pip install --upgrade youtube-dl ?

One of the reasons I use Ubuntu is to escape the madness of the way Windows installs applications. I install packages from the default Ubuntu repositories whenever possible. In this case I know that youtube-dl is a Python program, so I can locally install the latest version of youtube-dl in a Python virtual environment without messing up my filesystem.

Another alternative is to install the youtube-dl snap package:

sudo snap install youtube-dl # start with snap run youtube-dl 

I believe that since from now some things have changed in YouTube's service and applications' way to access it.

True. Google has been changing the way to access YouTube videos more frequently now than was the case three years ago, so in order to keep youtube-dl up-to-date, it has to be updated more frequently too. I have observed over the years that YouTube videos appear to be blocked mostly related to the date when they were uploaded.

Before I started using youtube-dl, I used a Firefox extension called Video DownloadHelper to download YouTube videos. I have come to prefer youtube-dl because it has the highest probability of successfully grabbing YouTube videos of any downloader that I have ever used.

karel
  • 114,770
  • thanks @karel for new information about the issue. Particularly I point 3 items: configure and use the virtual python environment, syntax's of youtube-dl and changing of google politics of video download. This answer is twice useful: enrich the question and enforce it is not duplicate of this one, as suggested above. – gwarah Aug 10 '16 at 14:08
  • 1
    Some of these google changes I believe is recently because VLC and Video Download Helper have same problem. – gwarah Aug 10 '16 at 14:21
2

The ability to download videos from YouTube is a constant battle as the company seeks to limit access to the site to the methods that they prefer. From the YouTube Terms of Service:

You agree not to access Content through any technology or means other than the video playback pages of the Service itself, the Embeddable Player, or other explicitly authorized means YouTube may designate.

The makers of youtube-dl constantly try to match the changes made by YouTube which aim to steer the user back to their preferred method of access. This is what you have bumped up against with your own download.

The repository version of youtube-dl is an aged version 2016.02.22 and the battle lines have long since moved on from there with the most recent version reporting:

andrew@ilium~$ youtube-dl --version
2016.08.10

The recommended method to update youtube-dl comes from the youtube-dl download page, modified slightly to remove the Ubuntu repository version:

sudo apt-get remove youtube-dl
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

On this same download page you will see instructions for the upgrade with curl and pip, use whichever you prefer as the end result is the same. Important to remove the repository version though, you only need one youtube-dl executable.

Note: On testing on my own system upgrade in this manner solved your issue completely and successfully downloaded both videos.

If you are curious have a look here where the battle is waged extracting the address from the YouTube page (this page showing the origin of your error) and see the efforts needed to provide a decent match for successful download.

References:

andrew.46
  • 38,003
  • 27
  • 156
  • 232