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

How To Get Section Name In Template Name #22697

Closed
AlBannaTechno opened this issue Oct 13, 2019 · 9 comments
Closed

How To Get Section Name In Template Name #22697

AlBannaTechno opened this issue Oct 13, 2019 · 9 comments

Comments

@AlBannaTechno
Copy link

@AlBannaTechno AlBannaTechno commented Oct 13, 2019

Hi

  • What the problem is

i try to download this series : Film Production

But i can't figure how to get section name in video name template

section name like Writing and Story , Camera and Sound ... i try many things described in readme file but nothing work
In This playlist videos categories on the next sequence

  • Writing and Story

    • Screenplays: Crash Course Film Production 1
    • Pitching and Pre-Production: Crash Course Film Production 2
  • Camera and Sound

    • The Filmmaker's Army: Crash Course Film Production 3
    • Dissecting The Camera: Crash Course Film Production 4
    • Sound Production: Crash Course Film Production 5

and so on ...
so its just a nested list

so i need to get Writing and Story , Camera and Sound ...
and append it to the name of downloaded file
with file templates like -o %(autonumber)02d.%(title)s.%(ext)s

Or create folders with these names and
download corresponding videos on it
so it will be
./Writing and Story/ Screenplays: Crash Course Film Production 1.mp4

Camera and Sound/The Filmmaker's Army: Crash Course Film Production 3.mp4

  • How it could be fixed

I try to modify the source code and change YoutubeDL.py: , Ln:633 : to

 def prepare_filename(self, info_dict):
        """Generate the output filename."""

        print("[OS] info_dict")

        for v in info_dict.keys():
            print ("%s:%s"%(v,info_dict[v]))
            print()
            print()
            print()

then i get all fetched data , but nothing contains sections name eg.Writing and Story

  • How your proposed solution would look like
    i don't know source code is little tricky

youtube-dl.exe -v

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v']
[debug] Encodings: locale cp1256, fs mbcs, out cp720, pref cp1256
[debug] youtube-dl version 2019.09.28
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: none
[debug] Proxy map: {}
@AlBannaTechno AlBannaTechno changed the title How To Sections Names In Template Name How To Get Section Names In Template Name Oct 13, 2019
@AlBannaTechno AlBannaTechno changed the title How To Get Section Names In Template Name How To Get Section Name In Template Name Oct 13, 2019
@dstftw dstftw closed this Oct 13, 2019
@dstftw dstftw added the incomplete label Oct 13, 2019
@AlBannaTechno
Copy link
Author

@AlBannaTechno AlBannaTechno commented Oct 13, 2019

@dstftw I guess you closed this question because of not providing version so i provide it
So is this feature available in /youtube-dl

@AlBannaTechno
Copy link
Author

@AlBannaTechno AlBannaTechno commented Oct 13, 2019

@dstftw I re populate the question with most required details

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 13, 2019

No such info is provided by Youtube.

@AlBannaTechno
Copy link
Author

@AlBannaTechno AlBannaTechno commented Oct 13, 2019

@dstftw Thanks for reply ,
I just have a final/last question i explore the source code and i notice using html parsing operations
so it make this problem not related to youtube it's not youtube API ? am i true ?
it's rely under id="title-container" in div so implement this not related to youtube itself ! that true or i miss-understand how ydl work

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 13, 2019

youtube-dl does not use Youtube API due to obvious reasons.

@AlBannaTechno
Copy link
Author

@AlBannaTechno AlBannaTechno commented Oct 13, 2019

@dstftw So What do you mean by saying No such info is provided by Youtube. ????? we pars the page then get what we want !!

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 13, 2019

I mean exactly what it spells. I'm not a black magician to know what you parse.

@AlBannaTechno
Copy link
Author

@AlBannaTechno AlBannaTechno commented Oct 13, 2019

@dstftw thanks , I am still can't understand what you mean and why this is not possible but i know this problem happend because of shortage of my knowledge so i will study the source code in the next first chance . 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
2 participants
You can’t perform that action at this time.