aandrew-me / ytDownloader

A modern GUI App for downloading Videos and Audios from hundreds of sites
https://ytdn.netlify.app/
GNU General Public License v3.0
949 stars 87 forks source link

[Feature Request]Add support for selecting more encoding formats when downloading the list #238

Open muyiacc opened 2 weeks ago

muyiacc commented 2 weeks ago

Description At present, when downloading the list, the video formats can be selected as automatic, mp4, and webm. After downloading mp4, I use ffmpeg to view the downloaded videos, and the encoding format is vp9. This format may not have good playback support for some devices, and online preview may also have problems after uploading to the cloud storage. I hope to choose a specific encoding format, just like downloading a single video. I can choose avc1, vp9 encoding formats and different file suffixes mp4, mkv, and webm to meet different needs.

muyiacc commented 2 weeks ago

Suggestions for design thinking:

When using yt dlp to view video metadata information, many different formats are listed, but not all videos in a list use the same encoding format. We can use priority to decide which format to download, such as this link:

yt-dlp -F https://youtube.com/playlist?list=PLD33E5618740295DF&si=2skulZWyB_TTJGi1

The video information is as follows:

[download] Downloading item 1 of 25
[youtube] Extracting URL: https://www.youtube.com/watch?v=13wt6cmCRK0
[youtube] 13wt6cmCRK0: Downloading webpage
WARNING: [youtube] Webpage contains broken formats (poToken experiment detected). Ignoring initial player response
[youtube] 13wt6cmCRK0: Downloading ios player API JSON
[youtube] 13wt6cmCRK0: Downloading player 57c75fa4
[youtube] 13wt6cmCRK0: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Retrying (1/3)...
[youtube] 13wt6cmCRK0: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Retrying (2/3)...
[youtube] 13wt6cmCRK0: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Retrying (3/3)...
[youtube] 13wt6cmCRK0: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Giving up after 3 retries
[youtube] 13wt6cmCRK0: Downloading m3u8 information
[info] Available formats for 13wt6cmCRK0:
ID  EXT   RESOLUTION FPS CH │   FILESIZE    TBR PROTO │ VCODEC           VBR ACODEC      ABR ASR MORE INFO
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb2 mhtml 48x27        0    │                   mhtml │ images                                   storyboard
sb1 mhtml 80x45        0    │                   mhtml │ images                                   storyboard
sb0 mhtml 160x90       0    │                   mhtml │ images                                   storyboard
233 mp4   audio only        │                   m3u8  │ audio only           unknown             Default
234 mp4   audio only        │                   m3u8  │ audio only           unknown             Default
139 m4a   audio only      2 │    2.30MiB    49k https │ audio only           mp4a.40.5   49k 22k low, m4a_dash
140 m4a   audio only      2 │    6.09MiB   129k https │ audio only           mp4a.40.2  129k 44k medium, m4a_dash
269 mp4   256x144     24    │ ~  7.33MiB   156k m3u8  │ avc1.4D400C     156k video only
160 mp4   256x144     24    │    1.56MiB    33k https │ avc1.4D400C      33k video only          144p, mp4_dash
603 mp4   256x144     24    │ ~  7.70MiB   163k m3u8  │ vp09.00.11.08   163k video only
229 mp4   426x240     24    │ ~ 14.62MiB   311k m3u8  │ avc1.4D4015     311k video only
133 mp4   426x240     24    │    3.47MiB    74k https │ avc1.4D4015      74k video only          240p, mp4_dash
604 mp4   426x240     24    │ ~ 13.67MiB   290k m3u8  │ vp09.00.20.08   290k video only
230 mp4   640x360     24    │ ~ 37.74MiB   801k m3u8  │ avc1.4D401E     801k video only
134 mp4   640x360     24    │    6.91MiB   147k https │ avc1.4D401E     147k video only          360p, mp4_dash
605 mp4   640x360     24    │ ~ 31.16MiB   662k m3u8  │ vp09.00.21.08   662k video only
231 mp4   854x480     24    │ ~ 63.64MiB  1352k m3u8  │ avc1.4D401E    1352k video only
135 mp4   854x480     24    │   11.32MiB   241k https │ avc1.4D401E     241k video only          480p, mp4_dash
606 mp4   854x480     24    │ ~ 55.63MiB  1181k m3u8  │ vp09.00.30.08  1181k video only
232 mp4   1280x720    24    │ ~102.51MiB  2177k m3u8  │ avc1.4D401F    2177k video only
136 mp4   1280x720    24    │   18.32MiB   389k https │ avc1.4D401F     389k video only          720p, mp4_dash
609 mp4   1280x720    24    │ ~104.98MiB  2229k m3u8  │ vp09.00.31.08  2229k video only
270 mp4   1920x1080   24    │ ~220.26MiB  4678k m3u8  │ avc1.640028    4678k video only
137 mp4   1920x1080   24    │   70.61MiB  1501k https │ avc1.640028    1501k video only          1080p, mp4_dash
614 mp4   1920x1080   24    │ ~180.16MiB  3826k m3u8  │ vp09.00.40.08  3826k video only
620 mp4   2560x1440   24    │ ~448.71MiB  9529k m3u8  │ vp09.00.50.08  9529k video only
625 mp4   3840x2160   24    │ ~891.50MiB 18933k m3u8  │ vp09.00.50.08 18933k video only
[download] Downloading item 2 of 25
[youtube] Extracting URL: https://www.youtube.com/watch?v=0FYjApop7Mk
[youtube] 0FYjApop7Mk: Downloading webpage
WARNING: [youtube] Webpage contains broken formats (poToken experiment detected). Ignoring initial player response
[youtube] 0FYjApop7Mk: Downloading ios player API JSON
[youtube] 0FYjApop7Mk: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Retrying (1/3)...
[youtube] 0FYjApop7Mk: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Retrying (2/3)...
[youtube] 0FYjApop7Mk: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Retrying (3/3)...
[youtube] 0FYjApop7Mk: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Giving up after 3 retries
[youtube] 0FYjApop7Mk: Downloading m3u8 information
[info] Available formats for 0FYjApop7Mk:
ID  EXT   RESOLUTION FPS HDR CH │   FILESIZE    TBR PROTO │ VCODEC           VBR ACODEC      ABR ASR MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb3 mhtml 48x27        1        │                   mhtml │ images                                   storyboard
sb2 mhtml 80x45        1        │                   mhtml │ images                                   storyboard
sb1 mhtml 160x90       1        │                   mhtml │ images                                   storyboard
sb0 mhtml 320x180      1        │                   mhtml │ images                                   storyboard
233 mp4   audio only            │                   m3u8  │ audio only           unknown             [en] Default
234 mp4   audio only            │                   m3u8  │ audio only           unknown             [en] Default
139 m4a   audio only          2 │  903.64KiB    49k https │ audio only           mp4a.40.5   49k 22k [en] low, m4a_dash
140 m4a   audio only          2 │    2.34MiB   130k https │ audio only           mp4a.40.2  130k 44k [en] medium, m4a_dash
269 mp4   256x144     24        │ ~  2.43MiB   135k m3u8  │ avc1.4D400C     135k video only
160 mp4   256x144     24        │  817.13KiB    44k https │ avc1.4D400C      44k video only          144p, mp4_dash
603 mp4   256x144     24        │ ~  2.90MiB   161k m3u8  │ vp09.00.11.08   161k video only
631 mp4   256x144     24 10     │ ~  3.47MiB   193k m3u8  │ vp09.02.11.10   193k video only
229 mp4   426x240     24        │ ~  4.01MiB   223k m3u8  │ avc1.4D4015     223k video only
133 mp4   426x240     24        │    1.66MiB    92k https │ avc1.4D4015      92k video only          240p, mp4_dash
604 mp4   426x240     24        │ ~  4.93MiB   274k m3u8  │ vp09.00.20.08   274k video only
632 mp4   426x240     24 10     │ ~  5.23MiB   290k m3u8  │ vp09.02.21.10   290k video only
230 mp4   640x360     24        │ ~  7.96MiB   442k m3u8  │ avc1.4D401E     442k video only
134 mp4   640x360     24        │    3.09MiB   171k https │ avc1.4D401E     171k video only          360p, mp4_dash
605 mp4   640x360     24        │ ~ 10.01MiB   556k m3u8  │ vp09.00.21.08   556k video only
633 mp4   640x360     24 10     │ ~ 11.67MiB   648k m3u8  │ vp09.02.30.10   648k video only
231 mp4   854x480     24        │ ~ 11.97MiB   665k m3u8  │ avc1.4D401E     665k video only
135 mp4   854x480     24        │    5.17MiB   287k https │ avc1.4D401E     287k video only          480p, mp4_dash
606 mp4   854x480     24        │ ~ 15.51MiB   862k m3u8  │ vp09.00.30.08   862k video only
634 mp4   854x480     24 10     │ ~ 19.76MiB  1098k m3u8  │ vp09.02.31.10  1098k video only
232 mp4   1280x720    24        │ ~ 22.28MiB  1238k m3u8  │ avc1.4D401F    1238k video only
136 mp4   1280x720    24        │    8.77MiB   486k https │ avc1.4D401F     486k video only          720p, mp4_dash
609 mp4   1280x720    24        │ ~ 24.86MiB  1381k m3u8  │ vp09.00.31.08  1381k video only
635 mp4   1280x720    24 10     │ ~ 41.48MiB  2304k m3u8  │ vp09.02.40.10  2304k video only
270 mp4   1920x1080   24        │ ~ 55.09MiB  3061k m3u8  │ avc1.640028    3061k video only
137 mp4   1920x1080   24        │   29.70MiB  1645k https │ avc1.640028    1645k video only          1080p, mp4_dash
614 mp4   1920x1080   24        │ ~ 42.56MiB  2364k m3u8  │ vp09.00.40.08  2364k video only
636 mp4   1920x1080   24 10     │ ~ 70.77MiB  3931k m3u8  │ vp09.02.41.10  3931k video only
620 mp4   2560x1440   24        │ ~168.70MiB  9372k m3u8  │ vp09.00.50.08  9372k video only
639 mp4   2560x1440   24 10     │ ~192.82MiB 10712k m3u8  │ vp09.02.50.10 10712k video only
625 mp4   3840x2160   24        │ ~342.58MiB 19032k m3u8  │ vp09.00.50.08 19032k video only
642 mp4   3840x2160   24 10     │ ~444.41MiB 24689k m3u8  │ vp09.02.51.10 24689k video only
[download] Downloading item 3 of 25
[youtube] Extracting URL: https://www.youtube.com/watch?v=LXb3EKWsInQ
[youtube] LXb3EKWsInQ: Downloading webpage
WARNING: [youtube] Webpage contains broken formats (poToken experiment detected). Ignoring initial player response
[youtube] LXb3EKWsInQ: Downloading ios player API JSON
[youtube] LXb3EKWsInQ: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Retrying (1/3)...
[youtube] LXb3EKWsInQ: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Retrying (2/3)...
[youtube] LXb3EKWsInQ: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Retrying (3/3)...
[youtube] LXb3EKWsInQ: Downloading web player API JSON
WARNING: [youtube] API returned broken formats (poToken experiment detected). Giving up after 3 retries
[youtube] LXb3EKWsInQ: Downloading m3u8 information
^C

 2024-08-31 18:51:36 ⌚  tao in ~/test
○ → [info] Available formats for LXb3EKWsInQ:
ID      EXT   RESOLUTION FPS HDR CH │   FILESIZE    TBR PROTO │ VCODEC           VBR ACODEC      ABR ASR MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb3     mhtml 48x27        0        │                   mhtml │ images                                   storyboard
sb2     mhtml 80x45        0        │                   mhtml │ images                                   storyboard
sb1     mhtml 160x90       0        │                   mhtml │ images                                   storyboard
sb0     mhtml 320x180      0        │                   mhtml │ images                                   storyboard
233     mp4   audio only            │                   m3u8  │ audio only           unknown             Default
234     mp4   audio only            │                   m3u8  │ audio only           unknown             Default
139-drc m4a   audio only          2 │    1.83MiB    49k https │ audio only           mp4a.40.5   49k 22k low, DRC, m4a_dash
139     m4a   audio only          2 │    1.83MiB    49k https │ audio only           mp4a.40.5   49k 22k low, m4a_dash
140-drc m4a   audio only          2 │    4.84MiB   129k https │ audio only           mp4a.40.2  129k 44k medium, DRC, m4a_dash
140     m4a   audio only          2 │    4.84MiB   129k https │ audio only           mp4a.40.2  129k 44k medium, m4a_dash
602     mp4   256x144     15        │ ~  3.27MiB    87k m3u8  │ vp09.00.10.08    87k video only
269     mp4   256x144     30        │ ~  6.39MiB   171k m3u8  │ avc1.4D400C     171k video only
160     mp4   256x144     30        │    2.69MiB    72k https │ avc1.4D400C      72k video only          144p, mp4_dash
603     mp4   256x144     30        │ ~  5.94MiB   159k m3u8  │ vp09.00.11.08   159k video only
631     mp4   256x144     60 10     │ ~ 11.57MiB   309k m3u8  │ vp09.02.11.10   309k video only
229     mp4   426x240     30        │ ~ 11.61MiB   310k m3u8  │ avc1.4D4015     310k video only
133     mp4   426x240     30        │    6.00MiB   161k https │ avc1.4D4015     161k video only          240p, mp4_dash
604     mp4   426x240     30        │ ~ 10.81MiB   289k m3u8  │ vp09.00.20.08   289k video only
632     mp4   426x240     60 10     │ ~ 21.62MiB   578k m3u8  │ vp09.02.21.10   578k video only
230     mp4   640x360     30        │ ~ 30.02MiB   802k m3u8  │ avc1.4D401E     802k video only
134     mp4   640x360     30        │   12.87MiB   344k https │ avc1.4D401E     344k video only          360p, mp4_dash
605     mp4   640x360     30        │ ~ 24.38MiB   651k m3u8  │ vp09.00.21.08   651k video only
633     mp4   640x360     60 10     │ ~ 46.90MiB  1253k m3u8  │ vp09.02.30.10  1253k video only
231     mp4   854x480     30        │ ~ 50.66MiB  1353k m3u8  │ avc1.4D401F    1353k video only
135     mp4   854x480     30        │   21.38MiB   572k https │ avc1.4D401F     572k video only          480p, mp4_dash
606     mp4   854x480     30        │ ~ 43.30MiB  1157k m3u8  │ vp09.00.30.08  1157k video only
634     mp4   854x480     60 10     │ ~ 83.33MiB  2226k m3u8  │ vp09.02.31.10  2226k video only
311     mp4   1280x720    60        │ ~142.10MiB  3796k m3u8  │ avc1.4D4020    3796k video only
298     mp4   1280x720    60        │   95.63MiB  2557k https │ avc1.4D4020    2557k video only          720p60, mp4_dash
612     mp4   1280x720    60        │ ~141.55MiB  3782k m3u8  │ vp09.00.40.08  3782k video only
635     mp4   1280x720    60 10     │ ~183.60MiB  4905k m3u8  │ vp09.02.40.10  4905k video only
312     mp4   1920x1080   60        │ ~233.05MiB  6226k m3u8  │ avc1.64002A    6226k video only
299     mp4   1920x1080   60        │  168.04MiB  4492k https │ avc1.64002A    4492k video only          1080p60, mp4_dash
617     mp4   1920x1080   60        │ ~232.96MiB  6224k m3u8  │ vp09.00.41.08  6224k video only
636     mp4   1920x1080   60 10     │ ~278.83MiB  7449k m3u8  │ vp09.02.41.10  7449k video only
623     mp4   2560x1440   60        │ ~527.86MiB 14102k m3u8  │ vp09.00.50.08 14102k video only
639     mp4   2560x1440   60 10     │ ~655.65MiB 17516k m3u8  │ vp09.02.50.10 17516k video only
628     mp4   3840x2160   60        │ ~  1.03GiB 28176k m3u8  │ vp09.00.51.08 28176k video only
642     mp4   3840x2160   60 10     │ ~  1.16GiB 31609k m3u8  │ vp09.02.51.10 31609k video only

Download priority is 1080p avc1, if vp9 is not available, then 720p acv1 vp9 format, suffix priority is mp4, mkv like this