meeb / tubesync

Syncs YouTube channels and playlists to a locally hosted media server
GNU Affero General Public License v3.0
1.84k stars 119 forks source link

Tubesync doesn't download videos even if the formats match #287

Open csjoh opened 1 year ago

csjoh commented 1 year ago

I'm having issues with Tubesync not downloading videos even though the video+audio formats match my settings.

I blew away my old instance today and set everything up anew as I was having a lot of trouble with the old instance, and while everything seems to work properly now, Tubesync throws a lot of errors in the logs and several hundred videos didn't download.

Like this one:

https://www.youtube.com/watch?v=o8IdqEj10C4

Media cannot be downloaded because it has no formats which match the source requirements. Media is marked to be skipped and will not be downloaded.

Source Viva La Dirt League Duration 00:01:07 Desired format 1080p (video:AVC1, audio:MP4A) 60FPS Fallback Get next best resolution or codec instead Skipping? Y Can download? N Available formats
ID: sb2 ID: sb1 ID: sb0 ID: 599 , audio:mp4a.40.5 @30.906k / 22050Hz ID: 600 , audio:opus @33.227k / 48000Hz ID: 139 , audio:mp4a.40.5 @48.881k / 22050Hz ID: 249 , audio:opus @48.881k / 48000Hz ID: 250 , audio:opus @60.828k / 48000Hz ID: 140 , audio:mp4a.40.2 @129.567k / 44100Hz (matched) ID: 251 , audio:opus @114.756k / 48000Hz ID: 17 , 144p (176x144), fps:6, video:mp4v.20.3 @77.98k , audio:mp4a.40.2 @0.0k / 22050Hz ID: 597 , 144p (256x144), fps:13, video:avc1.4d400b @30.846k ID: 598 , 144p (256x144), fps:13, video:vp9 @25.048k ID: 394 , 144p (256x144), fps:25, video:av01.0.00M.08 @60.461k ID: 160 , 144p (256x144), fps:25, video:avc1.4d400c @33.972k ID: 278 , 144p (256x144), fps:25, video:vp9 @69.696k ID: 395 , 240p (426x240), fps:25, video:av01.0.00M.08 @102.322k ID: 133 , 240p (426x240), fps:25, video:avc1.4d4015 @66.527k ID: 242 , 240p (426x240), fps:25, video:vp9 @109.106k ID: 396 , 360p (640x360), fps:25, video:av01.0.01M.08 @196.638k ID: 134 , 360p (640x360), fps:25, video:avc1.4d401e @127.078k ID: 18 , 360p (640x360), fps:25, video:avc1.42001E @256.38k , audio:mp4a.40.2 @0.0k / 44100Hz ID: 243 , 360p (640x360), fps:25, video:vp9 @228.902k ID: 397 , 480p (854x480), fps:25, video:av01.0.04M.08 @335.41k ID: 135 , 480p (854x480), fps:25, video:avc1.4d401e @198.084k ID: 244 , 480p (854x480), fps:25, video:vp9 @384.992k ID: 22 , 720p (1280x720), fps:25, video:avc1.64001F @441.427k , audio:mp4a.40.2 @0.0k / 44100Hz ID: 398 , 720p (1280x720), fps:25, video:av01.0.05M.08 @652.579k ID: 136 , 720p (1280x720), fps:25, video:avc1.4d401f @312.113k ID: 247 , 720p (1280x720), fps:25, video:vp9 @707.263k ID: 399 , 1080p (1920x1080), fps:25, video:av01.0.08M.08 @1126.315k ID: 137 , 1080p (1920x1080), fps:25, video:avc1.640028 @1089.322k (matched) ID: 248 , 1080p (1920x1080), fps:25, video:vp9 @1269.199k ID: 400 , 1440p (2560x1440), fps:25, video:av01.0.12M.08 @3612.051k ID: 271 , 1440p (2560x1440), fps:25, video:vp9 @3209.234k ID: 401 , 2160p (3840x2160), fps:25, video:av01.0.12M.08 @7136.695k ID: 313 , 2160p (3840x2160), fps:25, video:vp9 @10179.919k Matched formats Combined: no match Audio: 140 (exact match) Video: 137 (fallback)

The settings for the channel are as follow:

Source type: Youtube channel Key: VivaLaDirtLeague Name: Viva La Dirt League Directory: Viva La Dirt League Media format: Season S{yyyy}/{source_full} - S{yyyy} - {yyyy_mm_dd} - {title_full} WEBDL-{resolution}.{ext} Index schedule: 24 h Download media: Yes Download cap: No cap Delete old media: No Days to keep: 14 (default) Source resolution: 1080p (Full HD) Source video codec: AVC1 (H.264) Source audio codec: MP4A Prefer 60FPS: Yes Prefer HDR: No Fallback: Get next best resolution or codec instead Copy thumbnails: No Write NFO: No Write JSON: No

Based on this, and the fact that the downloader actually matches my preferred formats, Tubesync should NOT skip the media and actually download the videos without me having to go through hundreds of skipped videos and manually mark them for download.

Logs are probably available, just let me know what you need.

meeb commented 1 year ago

Thanks for the issue. If you skip then unskip the media does it download?

csjoh commented 1 year ago

Yes, when I manually unskip the media, they download just fine.

I also noticed that there were a few instances where TubeSync found a match (not fallback) for both audio and video and still the files weren’t downloaded.

Like this one from Kurzgesagt:

Media QImCld9YubE Why Are You Alive – Life, Energy & ATP https://www.youtube.com/watch?v=QImCld9YubE Downloading to: /downloads/video/Kurzgesagt - In a Nutshell Media cannot be downloaded because it has no formats which match the source requirements. Media is marked to be skipped and will not be downloaded.

Source

Kurzgesagt - In a Nutshellhttps://y.remiel.net/source/5fcf04c9-fabb-4ba9-b79c-df2ec30ccaa3

Duration

00:11:30

Desired format

1080p (video:AVC1, audio:MP4A) 60FPS

Fallback

Get next best resolution or codec instead

Skipping?

Y

Can download?

X

Available formats

ID: sb2 ID: sb1 ID: sb0 ID: 599 , audio:mp4a.40.5 @30.799k / 22050Hz ID: 600 , audio:opus @39.056k / 48000Hz ID: 139 , audio:mp4a.40.5 @48.795k / 22050Hz ID: 249 , audio:opus @56.832k / 48000Hz ID: 250 , audio:opus @74.084k / 48000Hz ID: 140 , audio:mp4a.40.2 @129.484k / 44100Hz (matched) ID: 251 , audio:opus @143.166k / 48000Hz ID: 17 , 144p (176x144), fps:8, video:mp4v.20.3 @80.192k , audio:mp4a.40.2 @0.0k / 22050Hz ID: 597 , 144p (256x144), fps:15, video:avc1.4d400b @32.251k ID: 598 , 144p (256x144), fps:15, video:vp9 @27.276k ID: 394 , 144p (256x144), fps:30, video:av01.0.00M.08 @71.354k ID: 160 , 144p (256x144), fps:30, video:avc1.4d400c @64.077k ID: 278 , 144p (256x144), fps:30, video:vp9 @84.214k ID: 395 , 240p (426x240), fps:30, video:av01.0.00M.08 @114.56k ID: 133 , 240p (426x240), fps:30, video:avc1.4d4015 @119.199k ID: 242 , 240p (426x240), fps:30, video:vp9 @123.379k ID: 396 , 360p (640x360), fps:30, video:av01.0.01M.08 @191.482k ID: 134 , 360p (640x360), fps:30, video:avc1.4d401e @199.835k ID: 18 , 360p (640x360), fps:30, video:avc1.42001E @328.757k , audio:mp4a.40.2 @0.0k / 44100Hz ID: 243 , 360p (640x360), fps:30, video:vp9 @201.376k ID: 397 , 480p (854x480), fps:30, video:av01.0.04M.08 @304.161k ID: 135 , 480p (854x480), fps:30, video:avc1.4d401f @261.475k ID: 244 , 480p (854x480), fps:30, video:vp9 @282.071k ID: 22 , 720p (1280x720), fps:30, video:avc1.64001F @799.109k , audio:mp4a.40.2 @0.0k / 44100Hz ID: 136 , 720p (1280x720), fps:30, video:avc1.4d401f @670.204k ID: 247 , 720p (1280x720), fps:30, video:vp9 @673.01k ID: 398 , 720p60 (1280x720), fps:60, video:av01.0.08M.08 @730.915k ID: 298 , 720p60 (1280x720), fps:60, video:avc1.4d4020 @473.868k ID: 302 , 720p60 (1280x720), fps:60, video:vp9 @605.998k ID: 399 , 1080p60 (1920x1080), fps:60, video:av01.0.09M.08 @1248.49k ID: 299 , 1080p60 (1920x1080), fps:60, video:avc1.64002a @1250.53k (matched) ID: 303 , 1080p60 (1920x1080), fps:60, video:vp9 @1571.058k

Matched formats

Combined: no match Audio: 140 (exact match) Video: 299 (exact match)

When I click Enable (unskip) media and confirm on the next page, the download starts almost immediately.

Snippet from the log while doing exactly that:

192.168.2.40 - christer [16/Nov/2022:18:10:21 +0100] "GET /media?only_skipped=yes&filter=5fcf04c9-fabb-4ba9-b79c-df2ec30ccaa3 HTTP/1.0" 200 17222 https://FQDN/media?filter=5fcf04c9-fabb-4ba9-b79c-df2ec30ccaa3 "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:10:21 +0100] "GET /static/styles/tubesync.css HTTP/1.0" 304 0 https://FQDN/media?only_skipped=yes&filter=5fcf04c9-fabb-4ba9-b79c-df2ec30ccaa3 "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:10:21 +0100] "GET /static/images/nothumb.png HTTP/1.0" 200 4176 https://FQDN/media?only_skipped=yes&filter=5fcf04c9-fabb-4ba9-b79c-df2ec30ccaa3 "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:10:23 +0100] "GET /media/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b HTTP/1.0" 200 16933 https://FQDN/media?only_skipped=yes&filter=5fcf04c9-fabb-4ba9-b79c-df2ec30ccaa3 "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:10:23 +0100] "GET /static/styles/tubesync.css HTTP/1.0" 304 0 https://FQDN/media/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:10:23 +0100] "GET /static/images/nothumb.png HTTP/1.0" 304 0 https://FQDN/media/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:13:17 +0100] "GET /media-enable/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b HTTP/1.0" 200 6573 https://FQDN/media/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:13:17 +0100] "GET /static/styles/tubesync.css HTTP/1.0" 304 0 https://FQDN/media-enable/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:13:17 +0100] "GET /media-enable/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b HTTP/1.0" 200 6573 https://FQDN/media/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:13:17 +0100] "GET /static/styles/tubesync.css HTTP/1.0" 304 0 https://FQDN/media-enable/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 2022-11-16 18:13:19,711 [tubesync/INFO] Scheduling task to download thumbnail for: Why Are You Alive – Life, Energy & ATP from: https://i.ytimg.com/vi/QImCld9YubE/maxresdefault.jpg 192.168.2.40 - christer [16/Nov/2022:18:13:19 +0100] "POST /media-enable/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b HTTP/1.0" 302 0 https://FQDN/media-enable/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:13:19 +0100] "GET /media/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b?message=enabled HTTP/1.0" 200 17011 https://FQDN/media-enable/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 192.168.2.40 - christer [16/Nov/2022:18:13:19 +0100] "GET /static/styles/tubesync.css HTTP/1.0" 304 0 https://FQDN/media/dff19b7b-cf50-4b4c-9f5e-61fdb827a14b?message=enabled "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0" 2022-11-16 18:13:22,754 [tubesync/INFO] Downloading media: QImCld9YubE (UUID: dff19b7b-cf50-4b4c-9f5e-61fdb827a14b) to: "/downloads/video/Kurzgesagt - In a Nutshell/Season S2020/Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.mkv" 2022-11-16 18:13:23,064 [tubesync/INFO] Resizing 1280x720 thumbnail to 430x240: https://i.ytimg.com/vi/QImCld9YubE/maxresdefault.jpg 2022-11-16 18:13:23,190 [tubesync/INFO] Saved thumbnail for: QImCld9YubE from: https://i.ytimg.com/vi/QImCld9YubE/maxresdefault.jpg 2022-11-16 18:13:27,449 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 9.6% of 102.89MiB at 8.78MiB/s, 00:10 remaining 2022-11-16 18:13:27,927 [tubesync/INFO] Downloading media: QImCld9YubE (UUID: dff19b7b-cf50-4b4c-9f5e-61fdb827a14b) to: "/downloads/video/Kurzgesagt - In a Nutshell/Season S2020/Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.mkv" 2022-11-16 18:13:29,247 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 19.7% of 102.89MiB at 1.76MiB/s, 00:46 remaining 2022-11-16 18:13:31,268 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 25.1% of 102.89MiB at 6.64MiB/s, 00:11 remaining 2022-11-16 18:13:32,579 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 29.9% of 102.89MiB at 7.35MiB/s, 00:09 remaining 2022-11-16 18:13:34,169 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 39.6% of 102.89MiB at 6.98MiB/s, 00:08 remaining 2022-11-16 18:13:35,232 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 39.7% of 102.89MiB at 2.69MiB/s, 00:23 remaining 2022-11-16 18:13:35,232 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 39.7% of 102.89MiB at 2.69MiB/s, 00:23 remaining 2022-11-16 18:13:35,797 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 49.9% of 102.89MiB at 6.34MiB/s, 00:08 remaining 2022-11-16 18:13:37,278 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 54.9% of 102.89MiB at 3.98MiB/s, 00:11 remaining 2022-11-16 18:13:37,278 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 54.9% of 102.89MiB at 3.98MiB/s, 00:11 remaining 2022-11-16 18:13:38,079 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 49.8% of 102.89MiB at 4.16MiB/s, 00:12 remaining 2022-11-16 18:13:39,214 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 65.2% of 102.89MiB at 6.58MiB/s, 00:05 remaining 2022-11-16 18:13:39,725 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 55.3% of 102.89MiB at 3.83MiB/s, 00:12 remaining 2022-11-16 18:13:41,527 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 74.9% of 102.89MiB at 5.90MiB/s, 00:04 remaining 2022-11-16 18:13:42,487 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 64.8% of 102.89MiB at 1.94MiB/s, 00:18 remaining 2022-11-16 18:13:42,889 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 80.4% of 102.89MiB at 3.62MiB/s, 00:05 remaining 2022-11-16 18:13:44,267 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 70.4% of 102.89MiB at 2.54MiB/s, 00:11 remaining 2022-11-16 18:13:44,267 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 70.4% of 102.89MiB at 2.54MiB/s, 00:11 remaining 2022-11-16 18:13:44,912 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 89.9% of 102.89MiB at 6.45MiB/s, 00:01 remaining 2022-11-16 18:13:46,729 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 99.6% of 102.89MiB at 4.97MiB/s, 00:00 remaining 2022-11-16 18:13:46,868 [tubesync/INFO] [youtube-dl] finished downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 102.89MiB in 00:20 2022-11-16 18:13:47,196 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 80.1% of 102.89MiB at 3.53MiB/s, 00:05 remaining 2022-11-16 18:13:49,023 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 89.6% of 102.89MiB at 3.57MiB/s, 00:03 remaining 2022-11-16 18:13:50,075 [tubesync/INFO] [youtube-dl] finished downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f140.m4a - 10.65MiB in 00:03 2022-11-16 18:13:50,699 [tubesync/INFO] [youtube-dl] downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 99.8% of 102.89MiB at 8.31MiB/s, 00:00 remaining ERROR: Unable to rename file: [Errno 2] No such file or directory: '/downloads/video/Kurzgesagt - In a Nutshell/Season S2020/Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4.part' -> '/downloads/video/Kurzgesagt - In a Nutshell/Season S2020/Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4' 2022-11-16 18:13:50,717 [tubesync/INFO] [youtube-dl] finished downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f299.mp4 - 102.89MiB in 00:20 2022-11-16 18:13:50,719 [tubesync/INFO] [youtube-dl] finished downloading: Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.f140.m4a - 10.65MiB in Unknown 2022-11-16 18:13:51,467 [tubesync/INFO] Successfully downloaded media: QImCld9YubE (UUID: dff19b7b-cf50-4b4c-9f5e-61fdb827a14b) to: "/downloads/video/Kurzgesagt - In a Nutshell/Season S2020/Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.mkv" 2022-11-16 18:13:51,539 [tubesync/INFO] Scheduling task to download thumbnail for: Why Are You Alive – Life, Energy & ATP from: https://i.ytimg.com/vi/QImCld9YubE/maxresdefault.jpg WARNING: Cannot update utime of file ERROR: [Errno 2] No such file or directory: '/downloads/video/Kurzgesagt - In a Nutshell/Season S2020/Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.temp.mkv' -> '/downloads/video/Kurzgesagt - In a Nutshell/Season S2020/Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.mkv' 2022-11-16 18:13:52,005 [tubesync/INFO] Successfully downloaded media: QImCld9YubE (UUID: dff19b7b-cf50-4b4c-9f5e-61fdb827a14b) to: "/downloads/video/Kurzgesagt - In a Nutshell/Season S2020/Kurzgesagt - In a Nutshell - S2020 - 2020-05-10 - Why Are You Alive – Life, Energy & ATP WEBDL-1080p.mkv" 2022-11-16 18:13:53,518 [tubesync/INFO] Resizing 1280x720 thumbnail to 430x240: https://i.ytimg.com/vi/QImCld9YubE/maxresdefault.jpg 2022-11-16 18:13:53,629 [tubesync/INFO] Saved thumbnail for: QImCld9YubE from: https://i.ytimg.com/vi/QImCld9YubE/maxresdefault.jpg

Hope that makes sense to you ☺

From: meeb @.> Sent: onsdag 16. november 2022 18:09 To: meeb/tubesync @.> Cc: Christer Solstrand Johannessen @.>; Author @.> Subject: Re: [meeb/tubesync] Tubesync doesn't download videos even if the formats match (Issue #287)

Thanks for the issue. If you skip then unskip the media does it download?

— Reply to this email directly, view it on GitHubhttps://github.com/meeb/tubesync/issues/287#issuecomment-1317364050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALWOHKPYBQN5OPDCWQ4YSLLWIUII5ANCNFSM6AAAAAASBK2BKQ. You are receiving this because you authored the thread.Message ID: @.**@.>>

meeb commented 1 year ago

Right, thanks for the extra details. This is probably do to with newer formats becoming available later on YouTube after the initial upload combined with a bug in ffmpeg where it failed to merge some types of streams into the final output download. This is fixed in the next release which should be available in just over a week or so. If the next release doesn't fix it I'll look deeper into what might be occurring.

csjoh commented 1 year ago

Cool, thanks. I'll update when the next version becomes available and add another channel to test.

In the meantime, I spent about an hour manually unskipping videos.. that was tedious :)

meeb commented 1 year ago

What skip/unskip does in this instance is manually force a refresh of the metadata from YouTube which I assume now includes additional codecs and formats that were not available on first index. There are other issues discussing this and some work on automatically re-indexing metadata is ongoing. The balance, as with most of these issues, isn't that technical it's things like making sure the number of automated requests to YouTube don't exceed sensible limits and other related concerns.

jwalzer commented 1 year ago

I have a lot of media stuck in "Media cannot be downloaded because it has no formats which match the source requirements." ... is there a way to issue a global "Refresh and try again" to tubesync?

Also, is there a switch for: "I don't care if its webm or avc1, and I don't care if its opus or m4a - just give me the highes resolution you can get !" ?

meeb commented 1 year ago

@jwalzer in :latest there's now a reset-metadata command which will wipe all of your local media items metadata and trigger it to be redownloaded. Note this will take a long time if you have a lot of media items. This is about as sane as you can get with a "mass refresh metadata" command, but use it with caution.

As for the second question, sure, resolution already takes preference over codecs so just set your source at 4k webm or something and tubesync should download whatever 4k content is available.

jwalzer commented 1 year ago

As for the second question, sure, resolution already takes preference over codecs so just set your source at 4k webm or something and tubesync should download whatever 4k content is available.

so just to ensure I understand this correctly: If I always select 4K Codec and AVC1 but a video is only avail in VP9 then it should download the 1920x1080 VP9 video, if this is the highes resolution available?

I mean, I have lots of errors for files, that I can DL without a problem if I exec yt-dl directly in the container and it downloads the highest resolution ...

PS: concerning the :latest tag. I would really recomment, giving an additional tag (like the date) to your builds, so you and others could reference specific versions. ... i.e. I have a local pull-through registry here that I must use, that caches images I pull from outside. This means, that your :latest tag may not be the one the user sees ..

meeb commented 1 year ago

Providing there's a resolution, FPS and HDR flag match the next best match will be to drop the codec requirement, so if you pick 4K AVC1 (and not 60fps and not HDR) and there's only 4K VP9 (and not 60fps and not HDR) then the VP9 stream will be the "next best match". The fallback logic attempts a stream match by dropping one requirement at a time. It gets a bit philosophical at some point, if you want 4K 60fps but there's only 4K 30fps or 1080p 60FPS with different codecs what stream should be selected etc.

Logic is here as a massive if statement:

https://github.com/meeb/tubesync/blob/main/tubesync/sync/matching.py#L126

This is verbose on purpose rather than nested loops to make it readable. The concept of "best" or "closest" is more complicated than it might seem, which is why tubesync implements this manually rather than just using yt-dlp's --best default which didn't do what I personally wanted.

There's not dated container tags is for a couple of reasons, first is technically tubesync is still in beta and secondly because if there's a release it's almost certainly going to contain critical yt-dlp or ffmpeg updates and pretty much every other container version is going to be broken and somewhat pointless. I have version tags, but they usually just generate loads of "I've installed tubesync vX.X container and it doesn't work" GitHub issues where as :latest does work. I appreciate using a general :latest tag is annoying for local image caches though. I'm pondering doing tubesync container tags that match with yt-dlp's release date format just to make it obvious.

JosiahBull commented 11 months ago

I have ~2000 media items waiting for download with this issue. I tried a mass metadata reset but it failed to correct the issue. :( Manually skipping/unskipping works - is there a way to trigger that for all videos skipped by the system?

JosiahBull commented 11 months ago

Had a look at the database schema, a tad unsure on how to resolve this. The easiest solution was to write a simple Selenium script to manually go through and click the button on each page to retry the video. Worked great for me, the gist is here: https://gist.github.com/JosiahBull/75eaf05dd74c709d12ea043548db072a

meeb commented 11 months ago

Heh, a nice hack, thanks. With the database schema you can reverse what skip and unskip actions do in the view here:

https://github.com/meeb/tubesync/blob/main/tubesync/sync/views.py#L633

An equivalent SQL query would be something like this to "set every indexed media item to skip":

UPDATE
    sync_media
SET
    metadata = NULL,
    downloaded = FALSE,
    downloaded_audio_codec = NULL,
    downloaded_video_codec = NULL,
    downloaded_container = NULL,
    downloaded_fps = NULL,
    downloaded_hdr = FALSE,
    downloaded_filesize = NULL,
    skip = TRUE,
    manual_skip = TRUE;

Then to "unskip" everything you would:

UPDATE
    sync_media
SET
    skip = FALSE,
    manual_skip = FALSE;

After that, you could reset the tasks:

$ docker exec -ti tubesync python3 /app/manage.py reset-tasks

And that should be the same as clicking "skip" then "unskip" on every media item. Note this would download every single media item again, so you might want to use a WHERE source_id = "some-source-uuid" filter to limit the query to a single source.

rajb245 commented 9 months ago

Right, thanks for the extra details. This is probably do to with newer formats becoming available later on YouTube after the initial upload combined with a bug in ffmpeg where it failed to merge some types of streams into the final output download. This is fixed in the next release which should be available in just over a week or so. If the next release doesn't fix it I'll look deeper into what might be occurring.

Has there been another release since this response was written? I've got tubesync docker setup as a systemd service with ExecStartPre=docker pull ghcr.io/meeb/tubesync:latest, so whenever I've encountered issues like this, I just restart the service or the machine and when the docker comes back up everything works again thanks to the new docker image. i tried rebooting a few days ago and i'm still getting this "exact match" problem where things are skipped despite showing that it selected sensible formats. i can report that skipping and unskipping manually works to download the stuff though. i haven't had to use the selenium or database query workarounds since it was like 20 videos or so in one shot, and other than that i only add a few videos to the syncing playlist each day at most.

i'm happy to provide logs if its helpful. thanks!

meeb commented 9 months ago

Yes the current version is 0.13.3, you can check the version you're running in the footer of the web UI.

koopernick commented 6 months ago

Any update regarding a definitive fix about this issue ?

I have to manually reset random links from this channel => https://www.youtube.com/@Koncrete It's only this channel for me, maybe there is something specific.

meeb commented 6 months ago

@koopernick from checking a couple of videos on that channel I would guess it's because some of the format streams are listed as available, but are "premium" and therefore fail to download without logging in with cookies.txt with a premium-enabled account. E.g.:

616 mp4 1920x1080 24 │ ~ 5.67GiB 3786k m3u8 │ vp09.00.40.08 3786k video only Premium

iyotee commented 1 month ago

21/07/2024,

all config to :latest, all same config here.

Still have the same problem.....Matches but cannot download video even it's matched.

got -> Video : 303 ( fallback )

I Tried everything motionned in other topic.

I think you must to check again about this since 17/07/2024 should have another methode again

meeb commented 1 month ago

@iyotee what's the YouTube video ID of the item you can't download?

iyotee commented 1 month ago

in fact i can download them.

It's when i try to access them via the domain.com/media/xxxx-xxx-xxx-xxx

the video is not running on the player, and when i'm clicking on download, not file found.

It's running on Caprover and here's the log i identified that can cause the error :

2024-07-21T21:18:09.386494599Z 2024/07/21 23:18:09 [error] 349#349: *375 open() "/downloads/downloads/2024-07-21_tuto-trading_gad-elmaleh-les-derniers-secrets-sur-ses-30-ans-de-carriere-lalcool-sa-religion_aZUa8GRDXqE1080p-vp9-opus.mkv" failed (2: No such file or directory), client: 10.0.1.24, server: , request: "GET /media-content/baf4b973-2398-409d-9102-428036f87e5e HTTP/1.1", upstream: "http://127.0.0.1:8080/media-content/baf4b973-2398-409d-9102-428036f87e5e", host: "tube.pixel3d.ch", referrer:

Looks like he tried to access double times in a download folder.

iyotee commented 1 month ago

i found a hack to solve it if someone using your app on Caprover.

7 / On Caprover TubeSync App config, Add a new persistant App.

Path in App : /downloads/downloads -> Path on host : /var/lib/docker/volumes/captain--yourAppname-downloads/_data

save & restart

meeb commented 1 month ago

That's almost certainly a configuration issue with your mount points, however I've no experience with Caprover so likely can't assist much here. Having said that, if your hack works then that's probably fine, it's just a directory mount after all providing the paths match up.