Автор Тема: [Решено] Сломан youtube-dl в сизифе  (Прочитано 2003 раз)

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 7 980
  • UNIX System V init
При попытке посмотреть список существующих форматов, youtube-dl крашится на
старте высыпая горы ошибок:
$ youtube-dl -F https://www.youtube.com/watch?v=sz8OInsZZ1c --verbose
Но help выводит нормально.

$ youtube-dl -F https://www.youtube.com/watch?v=sz8OInsZZ1c --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-F', u'https://www.youtube.com/watch?v=sz8OInsZZ1c', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.01.25
[debug] Python version 2.7.11 - Linux-4.4.44-std-def-alt1.1-i686-with-altlinux-ALT-Linux
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] sz8OInsZZ1c: Downloading webpage
[youtube] sz8OInsZZ1c: Downloading video info webpage
[youtube] sz8OInsZZ1c: Extracting video information
[youtube] {43} signature length 42.43, html5 player en_US-vflp0EuAP
[youtube] sz8OInsZZ1c: Downloading player /yts/jsbin/player-en_US-vflp0EuAP/base.js
ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 1035, in _decrypt_signature
    video_id, player_url, s
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 949, in _extract_signature_function
    errnote='Download of %s failed' % player_url)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 519, in _download_webpage
    res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding, data=data, headers=headers, query=query)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 426, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 406, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 2001, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 423, in open
    protocol = req.get_type()
  File "/usr/lib/python2.7/urllib2.py", line 285, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /yts/jsbin/player-en_US-vflp0EuAP/base.js
 (caused by ValueError(u'unknown url type: /yts/jsbin/player-en_US-vflp0EuAP/base.js',)); 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.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 1035, in _decrypt_signature
    video_id, player_url, s
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 949, in _extract_signature_function
    errnote='Download of %s failed' % player_url)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 519, in _download_webpage
    res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding, data=data, headers=headers, query=query)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 426, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 406, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 2001, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 423, in open
    protocol = req.get_type()
  File "/usr/lib/python2.7/urllib2.py", line 285, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /yts/jsbin/player-en_US-vflp0EuAP/base.js
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 694, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 359, in extract
    return self._real_extract(url)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 1624, in _real_extract
    encrypted_sig, video_id, player_url, age_gate)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 1045, in _decrypt_signature
    'Signature extraction failed: ' + tb, cause=e)
ExtractorError: Signature extraction failed: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 1035, in _decrypt_signature
    video_id, player_url, s
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 949, in _extract_signature_function
    errnote='Download of %s failed' % player_url)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 519, in _download_webpage
    res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding, data=data, headers=headers, query=query)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 426, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 406, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 2001, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 423, in open
    protocol = req.get_type()
  File "/usr/lib/python2.7/urllib2.py", line 285, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /yts/jsbin/player-en_US-vflp0EuAP/base.js
 (caused by ValueError(u'unknown url type: /yts/jsbin/player-en_US-vflp0EuAP/base.js',)); 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.

Багрепорт отравлен:
https://bugzilla.altlinux.org/show_bug.cgi?id=33073
« Последнее редактирование: 02.02.2017 03:49:40 от Speccyfighter »
ZX Spectrum 128K
Привет от NM:  # echo -e "\n[device]\nwifi.scan-rand-mac-address=no" >> /etc/NetworkManager/NetworkManager.conf

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 7 980
  • UNIX System V init
Re: Сломан youtube-dl в сизифе
« Ответ #1 : 02.02.2017 03:46:13 »
Проверил, свежая версия рабочая:


Ага-а...

Для чистоты убиваем каталог
~/.cache/youtube-dl

Запускаем репозиторный youtube-dl и он валит ошибки:
$ youtube-dl --version
2017.01.25
$ youtube-dl -F https://www.youtube.com/watch?v=sz8OInsZZ1c
[youtube] sz8OInsZZ1c: Downloading webpage
[youtube] sz8OInsZZ1c: Downloading video info webpage
[youtube] sz8OInsZZ1c: Extracting video information
[youtube] sz8OInsZZ1c: Downloading js player en_US-vflp0EuAP
ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 1035, in _decrypt_signature
    video_id, player_url, s
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/youtube.py", line 949, in _extract_signature_function
...

И ничего не находим
$ find ~/.cache/ -name "*youtube*"
$

Хорошо...
Качаем
wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl
chmod a+x /usr/local/bin/youtube-dl

отсюда youtube-dl
https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl
http://rg3.github.io/youtube-dl/download.html

в /usr/local/bin/

Запускаем скачанный youtube-dl и он отображает форматы без ошибок:
$ /usr/local/bin/youtube-dl --version
2017.02.01
$ date && /usr/local/bin/youtube-dl -F https://www.youtube.com/watch?v=sz8OInsZZ1c
Чт фев  2 03:05:46 +03 2017
[youtube] sz8OInsZZ1c: Downloading webpage
[youtube] sz8OInsZZ1c: Downloading video info webpage
[youtube] sz8OInsZZ1c: Extracting video information
[youtube] sz8OInsZZ1c: Downloading js player en_US-vflp0EuAP
[youtube] sz8OInsZZ1c: Downloading js player en_US-vflp0EuAP
[info] Available formats for sz8OInsZZ1c:
format code  extension  resolution note
140          m4a        audio only DASH audio  129k , m4a_dash container, mp4a.40.2@128k, 2.97MiB
171          webm       audio only DASH audio  134k , 1fps, vorbis@128k, 2.91MiB
...

При этом *sigfuncs появились
$ find ~/.cache/ -name "*youtube*"
/home/user/.cache/youtube-dl
/home/user/.cache/youtube-dl/youtube-sigfuncs
$ ls --full-time  \
~/.cache/youtube-dl/youtube-sigfuncs/*| \
awk '{print $7,$9}'
03:06:02.718833856 /home/user/.cache/youtube-dl/youtube-sigfuncs/js_en_US-чтото_42.41.json
03:05:57.806742270 /home/user/.cache/youtube-dl/youtube-sigfuncs/js_en_US-чтото_42.43.json

После чего, репозиторный youtube-dl
$ youtube-dl --version
2017.01.25

удачно и без ошибок запускается
$ youtube-dl -F https://www.youtube.com/watch?v=sz8OInsZZ1c
[youtube] sz8OInsZZ1c: Downloading webpage
[youtube] sz8OInsZZ1c: Downloading video info webpage
[youtube] sz8OInsZZ1c: Extracting video information
[info] Available formats for sz8OInsZZ1c:
format code  extension  resolution note
140          m4a        audio only DASH audio  129k , m4a_dash container, mp4a.40.2@128k, 2.97MiB
171          webm       audio only DASH audio  134k , 1fps, vorbis@128k, 2.91MiB
160          mp4        192x144    144p  110k , avc1.4d400c, 15fps, video only, 2.52MiB
...

Но стоит вычистить кеш youtube-dl в профиле пользователя от *sigfuncs, как ошибки посыпятся снова.
ZX Spectrum 128K
Привет от NM:  # echo -e "\n[device]\nwifi.scan-rand-mac-address=no" >> /etc/NetworkManager/NetworkManager.conf

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 7 980
  • UNIX System V init
Re: Сломан youtube-dl в сизифе
« Ответ #2 : 02.02.2017 03:48:54 »
youtube сломался...

Баг пофикшен сборкой свежей версии.
Свежая версия youtube-dl уехала в сизиф.
Спасибо Глебу за оперативность (мейнтейнер youtube-dl).
« Последнее редактирование: 02.02.2017 04:04:03 от Speccyfighter »
ZX Spectrum 128K
Привет от NM:  # echo -e "\n[device]\nwifi.scan-rand-mac-address=no" >> /etc/NetworkManager/NetworkManager.conf