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

Document ytsearch #7395

Open
gaming-hacker opened this issue Nov 7, 2015 · 7 comments
Open

Document ytsearch #7395

gaming-hacker opened this issue Nov 7, 2015 · 7 comments
Labels

Comments

@gaming-hacker
Copy link

@gaming-hacker gaming-hacker commented Nov 7, 2015

it isn't clear from the documentation how to search youtube using wildcards with regex.

for example, as i've tried various regex expressions but youtube-dl complains about providing a URL

"ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by HTTPError()); 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."

what i want to do is search youtube for say videos with keyword photograph for example and dump out the audio codec and the youtube video number for each one it finds

here is part of my bash script
opt="--ignore-config --ignore-errors --no-warnings "
opt+="--skip-download --match-title photograph "
opt+="--get-format --get-id --get-format "

youtube-dl ${opt} http://www.youtube.com

normal ywt searches should look like
https://www.youtube.com/results?search_query=def+leoppard+photograph&page=1

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 7, 2015

Post the full output you get with the --verbose option (as explained in the bug reporting instructions).

normal ywt searches should look like
https://www.youtube.com/results?search_query=def+leoppard+photograph&page=1

You can just run youtube-dl "ytsearch:def leoppard photograph" to get the first search result, and if you want for example 10 results you can just run with "ytsearch10:def leoppard photograph".

@gaming-hacker
Copy link
Author

@gaming-hacker gaming-hacker commented Nov 7, 2015

i don't it's a bug, there might be one of the keys that breaks python, i'll look into it but i think it's at least the documentation. ytsearch worked but ytsearch is another program/api, not part of youtube-dl and unless you search for it or know about it, there was no way someone would know to use it instead of the inbuilt search using the keys

--match-title REGEX Download only matching titles (regex or caseless sub-string)
--max-downloads NUMBER Abort after downloading NUMBER files

are GET/POST from ytsearch anyway?

@gaming-hacker
Copy link
Author

@gaming-hacker gaming-hacker commented Nov 7, 2015

erros

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--ignore-config', u'--verbose', u'--skip-download', u'--max-downloads', u'3', u'--match-title', u'zztop', u'--get-id', u'--get-format', u'--default-search', u'ytsearch100:']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.11.02
[debug] Python version 2.7.10 - Darwin-15.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg N-76449-g4746653-10-28-15, ffprobe N-76449-g4746653-10-28-15, rtmpdump 2.4
[debug] Proxy map: {}
Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.

this hangs

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--ignore-config', u'--verbose', u'--skip-download', u'--max-downloads', u'3', u'--match-title', u'zztop', u'--get-id', u'--get-format', u'--default-search', u'ytsearch100:', u'www.youtube.com']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.11.02
[debug] Python version 2.7.10 - Darwin-15.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg N-76449-g4746653-10-28-15, ffprobe N-76449-g4746653-10-28-15, rtmpdump 2.4
[debug] Proxy map: {}

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 7, 2015

ytsearch is another program/api, not part of youtube-dl

Wrong. It's a regular extractor provided by youtube-dl, an outright part of youtube-dl.

@gaming-hacker
Copy link
Author

@gaming-hacker gaming-hacker commented Nov 7, 2015

no, i'm not.

website ytsearch.com
github https://gist.github.com/Ultrabenosaurus/8974206b2cba0f1c615a

show me the youtube-dl documentation.

youtube-dl -h | grep ytsearch

no results

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 7, 2015

We don't and can't put description about every extractor in the documentation.

youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.

You didn't provide any URL or search query.

The seconds one doesn't hang - it processes 100 videos you've requested in search query. And since you've set quiet options (--get-id --get-format) and none of the videos match --match-title filter you've no output until all videos processed.

@dstftw dstftw closed this Nov 7, 2015
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 8, 2015

I think we should document the search capabilities of youtube-dl, contrary to other extractor which can just be tested by giving an URL to youtube-dl you can't easily discover the search extractors.

@jaimeMF jaimeMF reopened this Nov 8, 2015
@jaimeMF jaimeMF changed the title documentation: searching, regex Document ytsearch Nov 8, 2015
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.