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

More parameters for templates? #1938

Closed
cyberpunkbln opened this issue Dec 10, 2013 · 3 comments
Closed

More parameters for templates? #1938

cyberpunkbln opened this issue Dec 10, 2013 · 3 comments

Comments

@cyberpunkbln
Copy link

@cyberpunkbln cyberpunkbln commented Dec 10, 2013

Hello,

only a short issue. I have problems by downloads from southpark.de. The German Seasons 12 - 16 don't have the season and episode number and his from youtube-dl discovered pathname, so i must take the url without the named seasons.

rtmpe -cp75298.edgefcs.net_ondemand_mtviestor!_intlod_southpark_video_Deutsche_Season_12_1213_acts_sp_1213_act1_DEU_1280x720_1200.mp4

Its not pretty and a mass renamer solve some ugly names in path but it will be crazy if i can give the templates more options.

When i put all episodes in a batch-file like southpark.txt:

http://www.southpark.de/alle-episoden/s14e01/
http://www.southpark.de/alle-episoden/s14e05/
http://www.southpark.de/alle-episoden/s14e06/
http://www.southpark.de/alle-episoden/s14e13/

The Server from southpark made an rewrite of the urls and then youtube-dl use the resolved rewritten name of the path. Bit it will be great when i can use this original or resolved path in the template, like this:

%(batch-path)s => http://www.southpark.de/alle-episoden/s14e13/
%(batch-pathdir)s => /alle-episoden/s14e13/
%(batch-pathlastdir)s => s14e13

So i can use this plus the Title for prettyer naming the downloaded files:).

Only a suggestion. But it will make the southpark downloads a litte bit easier.

Thx
Greetings

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 10, 2013

For the first field requested you can use %(webpage_url)s, for example %(webpage_url)s-%(id)s.%(ext)s downloads to http -_www.southpark.de_alle-episoden_s14e01-292ca41c-ed01-11e0-aca6-0026b9414f30.mp4 (some of the characters are replaced to avoid problems with the filesystem).
The other ones seems too complicated and specific and someone will eventually ask for other variations (like firstdir or {n}dir)

@sirinath
Copy link

@sirinath sirinath commented Dec 17, 2013

Yes. nth dir is the sensible option. You get any dir you want.

@phihag phihag closed this in 29eb517 Dec 17, 2013
@phihag
Copy link
Contributor

@phihag phihag commented Dec 17, 2013

Complicated templating like {n}dir is definitely out of scope for youtube-dl. If you really need it (and I highly doubt that), write either a shell script or embed youtube-dl. Since youtube-dl 2013.12.17.1, you can use the new webpage_url_basename field, like this:

$ youtube-dl -o '%(webpage_url_basename)s_%(title)s.%(ext)s' http://www.southpark.de/alle-episoden/s14e01/ --get-filename
s14e01_South Park Intro HD.mp4
s14e01_South Park - Sexual Healing - Act 1.mp4
s14e01_South Park - Sexual Healing - Act 2.mp4
s14e01_South Park - Sexual Healing - Act 3.mp4
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
4 participants
You can’t perform that action at this time.