blackjack4494 / youtube-dlc

Command-line program to download various media from YouTube.com and other sites
https://blackjack4494.github.io/youtube-dlc/
The Unlicense
1.21k stars 13 forks source link

Bring in Pull Request to Convert webp to jpg #82

Closed feerlessleadr closed 4 years ago

feerlessleadr commented 4 years ago

Checklist

Description

First off, thanks for doing this, as my kids have been going crazy since I haven't been able to download any age-gated videos in forever, and this fork has fixed this for me.

Is there any chance that the follow PR could be added to convert webp to jpg:

https://github.com/ytdl-org/youtube-dl/pull/25717

It isn't my PR, but it's an issue I've been having on all my YT downloads, so was hoping you might consider adding to yt-dlc.

Thanks again for your consideration!

Extarys commented 4 years ago

I was just about to try to use that option for the first time, but I had to find that issue :angry: hahaha

Hope it'll be fixed eventually!

blackjack4494 commented 4 years ago

https://github.com/blackjack4494/youtube-dlc/pull/14

It's actually already merged and working.

PS D:\gitkraken\youtube-dl> python3 -m youtube_dlc "https://www.youtube.com/watch?v=ygmLEnwY4ec" --write-thumbnail -v [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['https://www.youtube.com/watch?v=ygmLEnwY4ec', '--write-thumbnail', '-v'] [debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252 [debug] youtube-dlc version 2020.09.12 [debug] Git HEAD: d115dc675 [debug] Python version 3.6.5 (CPython) - Windows-10-10.0.19041-SP0 [debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1 [debug] Proxy map: {} [youtube] ygmLEnwY4ec: Downloading webpage [debug] Default format spec: bestvideo+bestaudio/best [youtube] ygmLEnwY4ec: Downloading thumbnail ... [youtube] ygmLEnwY4ec: Writing thumbnail to: Here's why I Didn't Buy a Tesla-ygmLEnwY4ec.jpg [debug] Invoking downloader on .....

image

feerlessleadr commented 4 years ago

::EDIT:: I'm dumb and ran the wrong script originally, however I still have the same issue running the right dlc script. Updated the verbose output below.

Hmm - I'm not sure what I'm doing wrong then, since I'm also using the --write-thumbnail option and I'm still getting only webp files. Here is an example output below.

kevin@linuxserver:~/youtube-dl/scripts$ ./ytdl-kidsyoutube-singlevideo-verbose https://www.youtube.com/watch?v=Xhi8qpYCf98
[debug] System config: []
[debug] User config: []
[debug] Custom config: ['--format', '(bestvideo[vcodec=vp9][height>=1080][fps>30]/bestvideo[vcodec=vp9][height>=1080]/bestvideo[height>=1080]/bestvideo[vcodec=vp9][height>=720][fps>30]/bestvideo[vcodec=vp9][height>=720]/bestvideo[height>=720]/bestvideo)+(bestaudio[acodec=opus]/bestaudio)/best', '--merge-output-format', 'mkv', '--write-info-json', '--write-thumbnail', '--add-metadata', '--embed-subs', '--ignore-errors', '--proxy', '', '--download-archive', '/home/kevin/scripts/youtube/downloaded.txt']
[debug] Command-line args: ['--config-location', '/home/kevin/youtube-dl/config2.txt', '-v', '-o', '/home/kevin/youtube-dl/kidstmp/%(title)s.%(ext)s', 'https://www.youtube.com/watch?v=Xhi8qpYCf98']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dlc version 2020.09.12
[debug] Python version 3.6.9 (CPython) - Linux-4.15.0-117-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 4.3-2, ffprobe 4.3-2
[debug] Proxy map: {}
[youtube] Xhi8qpYCf98: Downloading webpage
[youtube] Xhi8qpYCf98: Downloading MPD manifest
[info] Writing video description metadata as JSON to: /home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.info.json
[youtube] Xhi8qpYCf98: Downloading thumbnail ...
[youtube] Xhi8qpYCf98: Writing thumbnail to: /home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.webp
[debug] Invoking downloader on 'https://manifest.googlevideo.com/api/manifest/dash/expire/1600020284/ei/3ApeX9OeCbbphwbA96j4BA/ip/71.187.72.15/id/5e18bcaa96027fdf/source/youtube/requiressl/yes/playback_host/r7---sn-8xgp1vo-ab5e.googlevideo.com/mh/c-/mm/31%2C29/mn/sn-8xgp1vo-ab5e%2Csn-ab5sznlk/ms/au%2Crdu/mv/m/mvi/7/pl/16/tx/23908006/txs/23908006%2C23908007/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/606250/vprv/1/mt/1599998563/fvip/2/keepalive/yes/beids/9466588/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Ctx%2Ctxs%2Chfr%2Cas%2Cvprv%2Citag/sig/AOq0QJ8wRgIhANILEk---SIbTNtzZgrjuSg_M3ftue04xqYFws3e3Lm1AiEAu4laHsd7iXRmcjpb620mgMkCTFLoHgl4f4kGLkuO92o%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AG3C_xAwRQIgWHbr1OIKHl9X437BVDjRDZEYZqhKS91tJ2xnR1kyxV0CIQD7KMzDL3Cp8tKdBiPfavLFbO2doGeBMlprdb5o_dqLXQ%3D%3D'
[dashsegments] Total fragments: 17
[download] Destination: /home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.f248.webm
[download]  82.4% of ~20.10MiB at  8.49MiB/s ETA 00:03[download] Got server HTTP error: HTTP Error 404: Not Found. Retrying fragment 15 (attempt 1 of 10)...
[download] 100% of 18.93MiB in 00:18
[debug] Invoking downloader on 'https://manifest.googlevideo.com/api/manifest/dash/expire/1600020284/ei/3ApeX9OeCbbphwbA96j4BA/ip/71.187.72.15/id/5e18bcaa96027fdf/source/youtube/requiressl/yes/playback_host/r7---sn-8xgp1vo-ab5e.googlevideo.com/mh/c-/mm/31%2C29/mn/sn-8xgp1vo-ab5e%2Csn-ab5sznlk/ms/au%2Crdu/mv/m/mvi/7/pl/16/tx/23908006/txs/23908006%2C23908007/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/606250/vprv/1/mt/1599998563/fvip/2/keepalive/yes/beids/9466588/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Ctx%2Ctxs%2Chfr%2Cas%2Cvprv%2Citag/sig/AOq0QJ8wRgIhANILEk---SIbTNtzZgrjuSg_M3ftue04xqYFws3e3Lm1AiEAu4laHsd7iXRmcjpb620mgMkCTFLoHgl4f4kGLkuO92o%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AG3C_xAwRQIgWHbr1OIKHl9X437BVDjRDZEYZqhKS91tJ2xnR1kyxV0CIQD7KMzDL3Cp8tKdBiPfavLFbO2doGeBMlprdb5o_dqLXQ%3D%3D'
[dashsegments] Total fragments: 10
[download] Destination: /home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.f251.webm
[download] 100% of 1.16MiB in 00:02
[ffmpeg] Merging formats into "/home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.mkv"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.f248.webm' -i 'file:/home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.f251.webm' -c copy -map 0:v:0 -map 1:a:0 'file:/home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.temp.mkv'
Deleting original file /home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.f248.webm (pass -k to keep)
Deleting original file /home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.f251.webm (pass -k to keep)
[ffmpeg] Adding metadata to '/home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.mkv'
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.mkv' -c copy -metadata 'title=Head Shoulders Knees Toes by The Wiggles | Lelica Palecco | The Jam Cats Music | Kids Songs' -metadata date=20200819 -metadata 'description=The Jam Cats Music - Lelica Palecco sings Head Shoulders Knees and Toes by The Wiggles
Subscribe for new videos every week!
https://www.youtube.com/user/TheJamCatsMusic?sub_confirmation=1

https://wp.thejamcatsmusic.com
https://www.instagram.com/thejamcats/
 https://www.facebook.com/thejamcats/

The Jam Cats Music is a children’s music program that comes to your school, daycare center or facility to add an exciting music class to your child’s curriculum each week! This program will provide a fun and nurturing environment in which children will be introduced to music through singing, dancing and playing musical instruments.  Our instructors are professional musicians who are committed to having fun with your child while introducing them to music!

We are all  about Kids Music, Kids Songs, Nursery Rhymes, Music Classes, Music Lessons.

The Jam Cats cartoon characters are used to inspire children and introduce them to our curriculum through monthly family guides, music cards, flash cards and poster boards.

The Jam Cats Band consists of:
Jagger - lead vocals, guitar
Jezzie - Keyboards, vocals
Jingo - Bass Guitar, vocals
Jankie - Drums, vocals' -metadata 'comment=The Jam Cats Music - Lelica Palecco sings Head Shoulders Knees and Toes by The Wiggles
Subscribe for new videos every week!
https://www.youtube.com/user/TheJamCatsMusic?sub_confirmation=1

https://wp.thejamcatsmusic.com
https://www.instagram.com/thejamcats/
 https://www.facebook.com/thejamcats/

The Jam Cats Music is a children’s music program that comes to your school, daycare center or facility to add an exciting music class to your child’s curriculum each week! This program will provide a fun and nurturing environment in which children will be introduced to music through singing, dancing and playing musical instruments.  Our instructors are professional musicians who are committed to having fun with your child while introducing them to music!

We are all  about Kids Music, Kids Songs, Nursery Rhymes, Music Classes, Music Lessons.

The Jam Cats cartoon characters are used to inspire children and introduce them to our curriculum through monthly family guides, music cards, flash cards and poster boards.

The Jam Cats Band consists of:
Jagger - lead vocals, guitar
Jezzie - Keyboards, vocals
Jingo - Bass Guitar, vocals
Jankie - Drums, vocals' -metadata 'purl=https://www.youtube.com/watch?v=Xhi8qpYCf98' -metadata 'artist=The Jam Cats Music' 'file:/home/kevin/youtube-dl/kidstmp/Head Shoulders Knees Toes by The Wiggles _ Lelica Palecco _ The Jam Cats Music _ Kids Songs.temp.mkv'
[ffmpeg] There aren't any subtitles to embed
blackjack4494 commented 4 years ago

Yeah it also downloads only webp for this video Xhi8qpYCf98. That is strange. Or not. I remembered there was some odd thing going on. Anyway have to look into it again at some point. Tho you should be able to use --exec to trigger post post processing event.

feerlessleadr commented 4 years ago

Thanks, anyone have any good scripts for post processing to convert webp to jpg while keeping the name of the file?

blackjack4494 commented 4 years ago

Depends whether you are on windows or unix. When under Linux you can use something like --exec "ffmpeg -i .webp .jpg". For Windows you need to make a batch script since you cannot use wildcard * on command line. Maybe Powershell allows that somehow.

feerlessleadr commented 4 years ago

Thanks, I am on Unix, so I thought it would have been more complicated than that. Appreciate the assistance.

blackjack4494 commented 4 years ago

Issue is kinda solved. Only need to change code to fix the cross drive issue.
So will close it for now.