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

Add options for --match-title #2223

Closed
davidhedlund opened this issue Jan 24, 2014 · 2 comments
Closed

Add options for --match-title #2223

davidhedlund opened this issue Jan 24, 2014 · 2 comments

Comments

@davidhedlund
Copy link

-o have options like %(playlist)s, %(id)s and so on but --match-title does not have them. Can you please add them?

@davidhedlund
Copy link
Author

Example:

title="Afgin - Old is Gold";
youtube-dl "ytsearch10:$title" -f 172/171/43/webm/ogg --extract-audio --no-overwrites --match-title ^"%(playlist)s"$ --verbose --ignore-errors --max-downloads 1

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['ytsearch10:Afgin - Old is Gold', '-f', '172/171/43/webm/ogg', '--extract-audio', '--no-overwrites', '--match-title', '^%(playlist)s$', '--verbose', '--ignore-errors', '--max-downloads', '1']
[debug] Encodings: locale 'UTF-8', fs 'UTF-8', out 'UTF-8', pref: 'UTF-8'
[debug] youtube-dl version 2014.01.23.4
[debug] Python version 2.7.3 - Linux-3.2.0-58-generic-x86_64-with-Trisquel-6.0-toutatis
[debug] Proxy map: {}
[youtube:search] query "Afgin - Old is Gold": Downloading page 1
[download] Downloading playlist: Afgin - Old is Gold
[youtube:search] playlist Afgin - Old is Gold: Collected 10 video ids (downloading 10 of them)
[download] Downloading video #1 of 10
[youtube] Setting language
[youtube] XCHrWyMpPhM: Downloading webpage
[youtube] XCHrWyMpPhM: Downloading video info webpage
[youtube] XCHrWyMpPhM: Extracting video information
[download] "Afgin - Old Is Gold [FULL ALBUM]" title did not match pattern "^%(playlist)s$"
[download] Downloading video #2 of 10
[youtube] 65MQ5ZAmusI: Downloading webpage
[youtube] 65MQ5ZAmusI: Downloading video info webpage
[youtube] 65MQ5ZAmusI: Extracting video information
[download] "Afgin - Old is Gold" title did not match pattern "^%(playlist)s$"
[download] Downloading video #3 of 10
[youtube] T4dVlDdZXJQ: Downloading webpage
[youtube] T4dVlDdZXJQ: Downloading video info webpage
[youtube] T4dVlDdZXJQ: Extracting video information
[download] "Afgin - Old is Gold (Part 2) -2009-" title did not match pattern "^%(playlist)s$"
[download] Downloading video #4 of 10
[youtube] LB4QKvDCW1A: Downloading webpage
[youtube] LB4QKvDCW1A: Downloading video info webpage
[youtube] LB4QKvDCW1A: Extracting video information
[download] "AFGIN - OLD IS GOLD" title did not match pattern "^%(playlist)s$"
[download] Downloading video #5 of 10
[youtube] BnGhelyzUtE: Downloading webpage
[youtube] BnGhelyzUtE: Downloading video info webpage
[youtube] BnGhelyzUtE: Extracting video information
[download] "AFGIN - Old Is Gold (part 2) VIDEO CLIP" title did not match pattern "^%(playlist)s$"
[download] Downloading video #6 of 10
[youtube] GtYD_YzdFGs: Downloading webpage
[youtube] GtYD_YzdFGs: Downloading video info webpage
[youtube] GtYD_YzdFGs: Extracting video information
[download] "Afgin - Old is Gold" title did not match pattern "^%(playlist)s$"
[download] Downloading video #7 of 10
[youtube] oKAkE5-9e4E: Downloading webpage
[youtube] oKAkE5-9e4E: Downloading video info webpage
[youtube] oKAkE5-9e4E: Extracting video information
[download] "Afgin @ Old Is Gold party" title did not match pattern "^%(playlist)s$"
[download] Downloading video #8 of 10
[youtube] qZvtGRbM7y8: Downloading webpage
[youtube] qZvtGRbM7y8: Downloading video info webpage
[youtube] qZvtGRbM7y8: Extracting video information
[download] "Afgin - Old is Gold" title did not match pattern "^%(playlist)s$"
[download] Downloading video #9 of 10
[youtube] E6WiBmYnfsE: Downloading webpage
[youtube] E6WiBmYnfsE: Downloading video info webpage
[youtube] E6WiBmYnfsE: Extracting video information
ERROR: requested format not available
Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 510, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 539, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 755, in process_video_result
expected=True)
ExtractorError: requested format not available

[download] Downloading video #10 of 10
[youtube] JoqG2B2GvYM: Downloading webpage
[youtube] JoqG2B2GvYM: Downloading video info webpage
[youtube] JoqG2B2GvYM: Extracting video information
[download] "Afgin - Return to the Source" title did not match pattern "^%(playlist)s$"

@phihag
Copy link
Contributor

phihag commented Jan 24, 2014

Some people want their filenames or directories to include uploaders, format IDs, duration, video service, playlist etc. Therefore, -o supports a wide variety of string replacements.

--match-title is intended for people who want to download just one video from a playlist. You are using it as a hack in order to get the video with the search term you are using, but that's very exceptional and - as I wrote before - more appropriate in a script. To boot, since you are invoking youtube-dl from a script, you already have a better representation of the title in a variable, so this feature wouldn't be needed anyway.

Therefore, the proposed change falls out of the scope of youtube-dl.

@phihag phihag closed this as completed Jan 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants