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

--match-title with 2 filter terms #1685

Closed
EpsilonAlpha opened this issue Oct 30, 2013 · 13 comments
Closed

--match-title with 2 filter terms #1685

EpsilonAlpha opened this issue Oct 30, 2013 · 13 comments

Comments

@EpsilonAlpha
Copy link

@EpsilonAlpha EpsilonAlpha commented Oct 30, 2013

Hi Guys,

I searched on the issues and didn't find one that's matching my issue:

I want to download a specific video from a ytuser 'gronhk' that has 'minecraft' and the episode number in it for example '#1170'

so I made this:

youtube-dl ytuser:gronkh --match-title "1170"

and it worked but just because the minecraft videos are the only one of this user with such a high episode number. I got a problem if I want to download episode for example 27 from gta 5 because there are other videos with that episode number from many series. Okay let's see what I've tried over an hour:

[] # [] # youtube-dl ytuser:Gronkh --match-title Minecraft#1170
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title "Minecraft#1170"
sh: [
]: command not found
[~] # youtube-dl
Usage: youtube-dl [options] url [url...]

youtube-dl: error: you must provide at least one URL
[] # [] # youtube-dl ytuser:Gronkh --match-title "Minecraft|#1170"
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title Minecraft|#1170
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title "Minecraft"|"#1170"
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title ("Minecraft"|"#1170")
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title (Minecraft|#1170)
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh ytsearch:Minecraft
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title {"Minecraft","#1170"}
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title={"Minecraft","#1170"}
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title{"Minecraft","#1170"}
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title{"Minecraft","#1170"}"
sh: [
]: command not found
[] #
[
] # [] # youtube-dl ytuser:Gronkh --match-title{"Minecraft","#1170"}"
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title "{"Minecraft","#1170"}"
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title "{Minecraft,#1170}"
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title {Minecraft,#1170}
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title "(Minecraft)+(1170)"
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title (Minecraft)+(1170)
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title (Minecraft)
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title "Minecraft"+"1170"
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title (?("Minecraft")"#1170")
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title (?("Minecraft")"#1170"|"")
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title (?("Minecraft")"#1170"|"")
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title $(?("Minecraft")"#1170"|"")
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title "Minecraft*#1170"
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title "Minecraft #1170"
sh: []: command not found
[
] # [] # youtube-dl ytuser:Gronkh --match-title "Minecraft #1170"
sh: [
]: command not found
[] # [] # youtube-dl ytuser:Gronkh --match-title ^s_Minecraft+s_1170

Well, there is even more examples but I think you guys get the idea. So the main question is:

How can i filter with 2 terms?

Btw. Google wasn't very helpful, and lead me to most of what you see.

@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Oct 30, 2013

my own mistake i copied with the uparrow [~] # always in front of my commands.

@EpsilonAlpha EpsilonAlpha reopened this Oct 30, 2013
@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Oct 30, 2013

Well, but the correct regex is still missing :)

@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Oct 30, 2013

Okay found it and ich want to share it with you:

youtube-dl ytuser:Gronkh --match-title {Minecraft,#1170}|grep 1170
[download] /share/Christoph/Downloads/MINECRAFT [HD ] #1170 - Dein Wunsch ist mir Befehl -) ★ Let's Play Minecraft.mp4 has already been downloaded

:)

@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Nov 7, 2013

It don't work anymore, i recently saw that the download-process takes too long so i looked in the Download-Directory and there are all kind of Videos (including that one i aimed for).

Did Youtube change something again?

@EpsilonAlpha EpsilonAlpha reopened this Nov 7, 2013
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 7, 2013

The problem is that the regex you are using is wrong, you have to use Minecraft|#1170, that works. Where did you find the regex?
I'm closing this, but if that doesn't solve the problem, please comment here and I'll reopen the issue.

@jaimeMF jaimeMF closed this Nov 7, 2013
@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Nov 7, 2013

First of all: Thanks for your help!

But it seems not to work. I use this command:

youtube-dl ytuser:Gronkh --match-title "{"Minecraft"|"1170"}">>/share/Christoph/Protokolle/download.txt

i've made a tail on the file with in addition " - " cause i know this comes after the episode number and helps me to skip all the other "did not match pattern"-messages, like this

tail -f /share/Christoph/Protokolle/download.txt|grep -i "1170 -"

and getting this:

"MINECRAFT [HD ] #1170 - Dein Wunsch ist mir Befehl :) ★ Let's Play Minecraft" title did not match pattern "{Minecraft|1170}"

I've also tried back ticks but that splitting up my pipe by "|", i also tried without the inner quotes and getting the same result.

@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Nov 7, 2013

Oh i find the REGEX with "Try-and-Error"-Principe :)

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 7, 2013

The command must be youtube-dl ytuser:Gronkh --match-title 'Minecraft|1170' >>/share/Christoph/Protokolle/download.txt, you can't enclose the expresion with {} (if you want you can use ()). We use the regex syntax provided by the python module re, it's documented in http://docs.python.org/2/library/re.html#regular-expression-syntax. I don't know if it will be useful, you may prefer to search a tutorial somewhere else.

@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Nov 7, 2013

Thanks for your quick answer. If i use it like this

clear;youtube-dl ytuser:Gronkh --match-title 'Minecraft|1170'>>/share/Christoph/Protokolle/download.txt    

the result ist a Downloading of i Video that i don't want:

[download] Destination: /share/Christoph/Downloads/MINECRAFT [HD ] #1179 - Hoppsi zum Obsi ★ Let's Play Minecraft ro3Nd-OZpKk.mp4
[download]  19.4% of 371.87MiB at 11.43MiB/s ETA 00:26^C

and i think i know why: the Expression seems to meaning that "Minecraft" OR "1170" have to be in the title. But what i'm searching for is that "Minecraft" AND "1170" are in the title.

Thanks for the Link, maybe we find together a solution.

@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Nov 7, 2013

Nailed it:

youtube-dl ytuser:Gronkh --match-title "Minecraft|1170">/share/Christoph/Protokolle/download.txt

Result:

[download] /share/Christoph/Downloads/MINECRAFT [HD ] #1170 - Dein Wunsch ist mir Befehl  -) ★ Let's Play Minecraft mKrL828sNrA.mp4 has already been downloaded

on the other Videos there comes the result "did not match pattern". I hope this helps other users.

Thanks jaimeMF for your help.

@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Nov 7, 2013

No, thats not working. I tested the Command by deleting one of the files that have been downloaded.

Still the same: i just get an OR not an AND

@phihag
Copy link
Contributor

@phihag phihag commented Nov 7, 2013

@EpsilonAlpha Well, | is OR in regular expressions. You want (?=.*Minecraft)(?=.*1170)

@EpsilonAlpha
Copy link
Author

@EpsilonAlpha EpsilonAlpha commented Nov 7, 2013

Yeah, that's great.

youtube-dl ytuser:Gronkh --match-title '(?=.*Minecraft)(?=.*1170)'>/share/Christoph/Protokolle/download.txt

was my command and the result of my first tail was

[download] /share/Christoph/Downloads/MINECRAFT [HD ] #1170 - Dein Wunsch ist mir Befehl  -) ★ Let's Play Minecraft mKrL828sNrA.mp4 has already been downloaded

the other tail was searching for % (if something has been downloaded it would make a status) was empty.

Meanwhile i also begun with experimenting with ?: well i want to learn something, so why =.* as prefix?

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.