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

An extractor error has occurred. #26204

Closed
hazzeee opened this issue Aug 1, 2020 · 8 comments
Closed

An extractor error has occurred. #26204

hazzeee opened this issue Aug 1, 2020 · 8 comments

Comments

@hazzeee
Copy link

@hazzeee hazzeee commented Aug 1, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.07.28
  • 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 bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

root@vps-30748f4f:~# youtube-dl test test -v
[debug] System config: [u'--cookies', u'/usr/local/bin/cookies.txt', u'-x', u'--                                                                                        default-search', u'auto', u'--playlist-items', u'1']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'test', u'test', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 2.7.16 (CPython) - Linux-4.19.0-5-cloud-amd64-x86_64-with                                                                                        -debian-10.0
[debug] exe versions: ffmpeg 4.1.6-1, ffprobe 4.1.6-1
[debug] Proxy map: {}
[youtube:search] query "test": Downloading page 1
ERROR: An extractor error has occurred. (caused by KeyError(1,)); 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/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/common.py", line 2995, in                                                                                         _real_extract
    return self._get_n_results(query, 1)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 3183, i                                                                                        n _get_n_results
    html_content = data[1]['body']['content']
KeyError: 1
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 543, in                                                                                         extract
    raise ExtractorError('An extractor error has occurred.', cause=e)
ExtractorError: An extractor error has occurred. (caused by KeyError(1,)); pleas                                                                                        e report this issue on https://yt-dl.org/bug . Make sure you are using the lates                                                                                        t version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the -                                                                                        -verbose flag and include its complete output.

Description

I want to make search for "TS3AudioBot", i tried with config which you gived to me, but im having that error, i searched issues but didnt find anything that can help me, can anyone of you give me config for youtube search for "TS3AudioBots" and say how to solve this error, or i can give you server info and you can try to fix it and make youtube search works.

@Gauthamastro
Copy link

@Gauthamastro Gauthamastro commented Aug 1, 2020

I am also having the same issue, but it always occurs after 5th song that I am downloading

@peet1993
Copy link

@peet1993 peet1993 commented Aug 1, 2020

I have the same problem.
I found out that the problem only occurs when a cookie file is given - Youtube answers the download of the search page in this case with {"reload":"now"} only, nothing else (common.py, _download_webpage_handle, Line 650). Without the cookie file, the expected data is returned and can be parsed into a json.

@peet1993
Copy link

@peet1993 peet1993 commented Aug 1, 2020

I wrote a hotfix for the problem. This is not how one should solve it, but it works. Maybe it helps someone!
peet1993/youtube-dl@56817ed

A real fix would need the reason why the reload answer happens. However, I'm not quite sure where to start for this.

@hazzeee
Copy link
Author

@hazzeee hazzeee commented Aug 1, 2020

@peet1993 hey, thanks for your answer, where i need to put that?

@hazzeee
Copy link
Author

@hazzeee hazzeee commented Aug 1, 2020

@peet1993 i changed it into youtube.py but still have problem, can you send me full youtube.py file?

@hazzeee
Copy link
Author

@hazzeee hazzeee commented Aug 1, 2020

image

@peet1993
Copy link

@peet1993 peet1993 commented Aug 1, 2020

Well, your "youtube-dl" is probably a precompiled executable located somewhere else on your filesystem. It is not updated when you change code in your cloned repository. You would have to clone my fork, build and then run the compilation result "youtube-dl" - or copy my changes to cloned version of this repository and do the same.

By the way, you should probably change the title of this issue. "An extractor error has occurred" is not very descriptive. Something like "Youtube search extractor fails when youtube cookies given" should be more helpful to the devs.

@hazzeee
Copy link
Author

@hazzeee hazzeee commented Aug 1, 2020

Well, your "youtube-dl" is probably a precompiled executable located somewhere else on your filesystem. It is not updated when you change code in your cloned repository. You would have to clone my fork, build and then run the compilation result "youtube-dl" - or copy my changes to cloned version of this repository and do the same.

By the way, you should probably change the title of this issue. "An extractor error has occurred" is not very descriptive. Something like "Youtube search extractor fails when youtube cookies given" should be more helpful to the devs.

yes i already cloned your fork and built it, now everything work 👍
Thanks!

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