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

Periodic problem with ytsearch: #6084

Closed
joeschmoe40 opened this issue Jun 25, 2015 · 9 comments
Closed

Periodic problem with ytsearch: #6084

joeschmoe40 opened this issue Jun 25, 2015 · 9 comments

Comments

@joeschmoe40
Copy link

@joeschmoe40 joeschmoe40 commented Jun 25, 2015

I have a script that uses youtube-dl and the 'ytsearch:" functionality. Periodically (about once every 3 or 4 runs), it fails to find what it should find. Error message is as shown below. I just retry it, with exactly the same command line and args and it succeeds. Any ideas what causes this? Latest version (2015.06.25) of the program. Note: Example below is one specific search string but it happens all the time with all sorts of (pop music) searches. This is only the one specific (latest) instance I've seen of it.

$ youtube-dl.py -f best -j "ytsearch: let me be there olivia" > outputfile
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/bin/youtube-dl.py/main.py", line 19, in
File "/usr/local/bin/youtube-dl.py/youtube_dl/init.py", line 405, in main
File "/usr/local/bin/youtube-dl.py/youtube_dl/init.py", line 395, in _real_main
File "/usr/local/bin/youtube-dl.py/youtube_dl/YoutubeDL.py", line 1502, in download
File "/usr/local/bin/youtube-dl.py/youtube_dl/YoutubeDL.py", line 650, in extract_info
File "/usr/local/bin/youtube-dl.py/youtube_dl/extractor/common.py", line 273, in extract
File "/usr/local/bin/youtube-dl.py/youtube_dl/extractor/common.py", line 1099, in _real_extract
File "/usr/local/bin/youtube-dl.py/youtube_dl/extractor/youtube.py", line 1524, in _get_n_results
File "/usr/lib/python2.7/re.py", line 177, in findall
return _compile(pattern, flags).findall(string)
TypeError: expected string or buffer
$

@joeschmoe40
Copy link
Author

@joeschmoe40 joeschmoe40 commented Jun 25, 2015

Here's another one - same general idea, but different (and better) error messages.
(As noted previously, when you retry, the error message goes away and it works as it should)

$ youtube-dl.py -f best -j "ytsearch: chicago i" > outputfile
Running youtube-dl ... ERROR: Signature extraction failed: Traceback (most recent call last):
File "/usr/local/bin/youtube-dl.py/youtube_dl/extractor/youtube.py", line 658, in _decrypt_signature
video_id, player_url, s
File "/usr/local/bin/youtube-dl.py/youtube_dl/extractor/youtube.py", line 550, in _extract_signature_function
raise ExtractorError('Cannot identify player %r' % player_url)
ExtractorError: Cannot identify player u'https://s.ytimg.com/yts/jsbin/player-en_US-vflFRA1IZ/base.js'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
(caused by ExtractorError(u"Cannot identify player u'https://s.ytimg.com/yts/jsbin/player-en_US-vflFRA1IZ/base.js'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U 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; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
$ youtube-dl.py --version
2015.06.15
$

NOTE: I see now that this machine is running the 6/15 version, not 6/25. I haven't turned on the auto-update script for this machine yet. Anyway, I've seen these errors for several weeks now, and I have seen them on the 6/25 version, though maybe not as often as on the on the 6/15. Anyway, it is definitely a real problem in all recent versions.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jun 26, 2015

I could reproduce the error once yesterday, but I have tried a few times today and it works. It would be helpful if you run it with --write-pages and post the generated files when it fails.

@joeschmoe40
Copy link
Author

@joeschmoe40 joeschmoe40 commented Jun 26, 2015

OK - I'll try that. Of course, now it will start working again...

Anyway, I'm glad you were able to reproduce it at least once.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Aug 21, 2015

@acardh
Copy link

@acardh acardh commented Aug 21, 2015

I was getting this "TypeError: expected string or buffer" when trying to download the following video:

$ youtube-dl https://www.youtube.com/watch?t=29&v=n_ztW_LLdZo
[1] 21662
$ [generic] watch?t=29: Requesting header
[redirect] Following redirect to https://www.youtube.com/supported_browsers?next_url=%2F
[youtube:user] supported_browsers: Downloading channel page
WARNING: Unable to download webpage: HTTP Error 404: Not Found
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/bin/youtube-dl/main.py", line 19, in
File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 410, in main
File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 400, in _real_main
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1653, in download
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 666, in extract_info
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 719, in process_ie_result
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 655, in extract_info
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 286, in extract
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1604, in _real_extract
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 677, in _html_search_meta
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 577, in _html_search_regex
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 547, in _search_regex
File "/usr/lib/python2.7/re.py", line 142, in search
return _compile(pattern, flags).search(string)
TypeError: expected string or buffer

$ youtube-dl --version
2015.08.16.1

And with this other video it worked fine:

$ youtube-dl --prefer-ffmpeg https://www.youtube.com/watch?v=IME3cj1RVF8
[youtube] IME3cj1RVF8: Downloading webpage
[youtube] IME3cj1RVF8: Downloading video info webpage
[youtube] IME3cj1RVF8: Extracting video information
[youtube] IME3cj1RVF8: Downloading DASH manifest
[youtube] IME3cj1RVF8: Downloading DASH manifest
[download] Destination: Alex Morgan - Best Goals-IME3cj1RVF8.f136.mp4
[download] 100% of 28.78MiB in 00:02
[download] Destination: Alex Morgan - Best Goals-IME3cj1RVF8.f141.m4a
[download] 100% of 4.93MiB in 00:00
[ffmpeg] Merging formats into "Alex Morgan - Best Goals-IME3cj1RVF8.mp4"
Deleting original file Alex Morgan - Best Goals-IME3cj1RVF8.f136.mp4 (pass -k to keep)
Deleting original file Alex Morgan - Best Goals-IME3cj1RVF8.f141.m4a (pass -k to keep)

I tried the first one with and without the "--prefer-ffmpeg" with the same results, but it worked when I tried it quoting the URL:

$ youtube-dl --prefer-ffmpeg "https://www.youtube.com/watch?t=29&v=n_ztW_LLdZo"
[youtube] n_ztW_LLdZo: Downloading webpage
[youtube] n_ztW_LLdZo: Downloading video info webpage
[youtube] n_ztW_LLdZo: Extracting video information
[youtube] n_ztW_LLdZo: Downloading DASH manifest
[youtube] n_ztW_LLdZo: Downloading DASH manifest
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: Alex Morgan SI Swimsuit Exclusive-n_ztW_LLdZo.f247.webm
[download] 100% of 22.32MiB in 00:02
[download] Destination: Alex Morgan SI Swimsuit Exclusive-n_ztW_LLdZo.f141.m4a
[download] 100% of 4.57MiB in 00:00
[ffmpeg] Merging formats into "Alex Morgan SI Swimsuit Exclusive-n_ztW_LLdZo.mkv"
Deleting original file Alex Morgan SI Swimsuit Exclusive-n_ztW_LLdZo.f247.webm (pass -k to keep)
Deleting original file Alex Morgan SI Swimsuit Exclusive-n_ztW_LLdZo.f141.m4a (pass -k to keep)
$

Thanks to @dstftw for the advice.

@comradekingu
Copy link

@comradekingu comradekingu commented Jan 10, 2017

$ youtube-dl https://www.youtube.com/watch?v=A8204bAX_h0
[youtube] A8204bAX_h0: Downloading webpage
[youtube] A8204bAX_h0: Downloading video info webpage
[youtube] A8204bAX_h0: Extracting video information
[youtube] A8204bAX_h0: Downloading js player en_US-vflsagga9
ERROR: Signature extraction failed: Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1001, in _decrypt_signature
video_id, player_url, s
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 928, in _extract_signature_function
cache_res = res(test_string)
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 980, in
return lambda s: initial_function([s])
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 254, in resf
res, abort = self.interpret_statement(stmt, local_vars)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 55, in interpret_statement
v = self.interpret_expression(expr, local_vars, allow_recursion)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 174, in interpret_expression
return objmember
KeyError: 'qC'
(caused by KeyError('qC',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.


$ youtube-dl --verbose https://www.youtube.com/watch?v=A8204bAX_h0
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'https://www.youtube.com/watch?v=A8204bAX_h0']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.06.30
[debug] Python version 3.4.3 - Linux-4.8.4-pclos1-x86_64-with-mandrake-2017-PCLinuxOS
[debug] exe versions: ffmpeg 2.8.10, ffprobe 2.8.10
[debug] Proxy map: {}
[youtube] A8204bAX_h0: Downloading webpage
[youtube] A8204bAX_h0: Downloading video info webpage
[youtube] A8204bAX_h0: Extracting video information
[youtube] {43} signature length 44.40, html5 player en_US-vflsagga9
[youtube] A8204bAX_h0: Downloading player https://s.ytimg.com/yts/jsbin/player-en_US-vflsagga9/base.js
ERROR: Signature extraction failed: Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1001, in _decrypt_signature
video_id, player_url, s
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 928, in _extract_signature_function
cache_res = res(test_string)
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 980, in
return lambda s: initial_function([s])
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 254, in resf
res, abort = self.interpret_statement(stmt, local_vars)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 55, in interpret_statement
v = self.interpret_expression(expr, local_vars, allow_recursion)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 174, in interpret_expression
return objmember
KeyError: 'qC'
(caused by KeyError('qC',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1001, in _decrypt_signature
video_id, player_url, s
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 928, in _extract_signature_function
cache_res = res(test_string)
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 980, in
return lambda s: initial_function([s])
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 254, in resf
res, abort = self.interpret_statement(stmt, local_vars)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 55, in interpret_statement
v = self.interpret_expression(expr, local_vars, allow_recursion)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 174, in interpret_expression
return objmember
KeyError: 'qC'
Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1001, in _decrypt_signature
video_id, player_url, s
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 928, in _extract_signature_function
cache_res = res(test_string)
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 980, in
return lambda s: initial_function([s])
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 254, in resf
res, abort = self.interpret_statement(stmt, local_vars)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 55, in interpret_statement
v = self.interpret_expression(expr, local_vars, allow_recursion)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 174, in interpret_expression
return objmember
KeyError: 'qC'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 676, in extract_info
ie_result = ie.extract(url)
File "/usr/bin/youtube-dl/youtube_dl/extractor/common.py", line 343, in extract
return self._real_extract(url)
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1574, in _real_extract
encrypted_sig, video_id, player_url, age_gate)
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1011, in _decrypt_signature
'Signature extraction failed: ' + tb, cause=e)
youtube_dl.utils.ExtractorError: Signature extraction failed: Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1001, in _decrypt_signature
video_id, player_url, s
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 928, in _extract_signature_function
cache_res = res(test_string)
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 980, in
return lambda s: initial_function([s])
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 254, in resf
res, abort = self.interpret_statement(stmt, local_vars)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 55, in interpret_statement
v = self.interpret_expression(expr, local_vars, allow_recursion)
File "/usr/bin/youtube-dl/youtube_dl/jsinterp.py", line 174, in interpret_expression
return objmember
KeyError: 'qC'
(caused by KeyError('qC',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 10, 2017

@comradekingu that's a different problem and is already fixed. Update to 2017.01.10

@joeschmoe40
Copy link
Author

@joeschmoe40 joeschmoe40 commented Jan 10, 2017

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 28, 2017

This is most likely fixed by a49eccd. Feel free to open a new issue if it's still broken in the next version. For another error (TypeError: expected string or buffer) - it's working fine now. If that appears again, please open a new issue, too.

@yan12125 yan12125 closed this May 28, 2017
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
6 participants
You can’t perform that action at this time.