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

Old videos don't download #183

Closed
freddy2659 opened this issue Nov 10, 2021 · 24 comments
Closed

Old videos don't download #183

freddy2659 opened this issue Nov 10, 2021 · 24 comments

Comments

@freddy2659
Copy link

freddy2659 commented Nov 10, 2021

Using the "Get next best resolution or codec" option doesn't retrieve videos that are very old (2009 at 240p best resolution).

Example channel ID: UCDsElQQt_gCZ9LgnW-7v-cQ
Example video: https://www.youtube.com/watch?v=QCUCTLk05cA

The reason provided: Media cannot be downloaded because it has no formats which match the source requirements.
Available formats: Media has no indexed available formats
Desired format: 1080p (video:VP9, audio:OPUS) 60FPS HDR

I'm not sure if one of the flags (60FPS, HDR, OPUS, VP9. 1080p) is causing it to ignore the video that IS available? Or if it's just because the video doesn't provide the information expected.

It could also be because it is both the next best resolution AND codec?

@meeb
Copy link
Owner

meeb commented Nov 11, 2021

Thanks for the issue. Yeah that should be matched, it indeed has a 240p version and the cut-off was lowered to 240p in #162 so something has changed in the metadata most likely that's causing the matching code to require a tweak.

@azukaar
Copy link

azukaar commented Feb 2, 2022

Noticed the same issue, the log does have additional infos tho: "has no published date set, marking to be skipped" on old videos, may be some older videos have a different format for their metadata that TubeSync does not understand

@meeb
Copy link
Owner

meeb commented Feb 3, 2022

@azukaar can you paste a link to a video that has that error? If it is legitimately missing a publish date in the metadata that would cause this issue.

@azukaar
Copy link

azukaar commented Feb 3, 2022

Hello! weirdly enough, I was going back to Tubesync to get such videos, all the videos marked as skipped by the system seems to have been downloaded anyway now, despite of having that message in the log "has no published date set, marking to be skipped",
Regardless here's an example of a video that caused this log, and was marked as skipped, but that eventually got downloaded anyway: /watch?v=NNhzYkXE1i4
Note that unlike what I initially thought, this is a fairly recent video so the issue might not be related, and may be is just a logging issue.

2022-02-02 19:27:25,956 [tubesync/WARNING] Media: Todo / NNhzYkXE1i4 has no published date set, marking to be skipped
2022-02-02 19:27:26,120 [tubesync/INFO] Scheduling task to download metadata for: https://www.youtube.com/watch?v=NNhzYkXE1i4
2022-02-02 19:27:26,308 [tubesync/INFO] Indexed media: Todo / NNhzYkXE1i4

@meeb
Copy link
Owner

meeb commented Feb 3, 2022

That video does have an upload date, what I can only assume is the first attempt to get the videos metadata failed and the video would have been marked to be skipped. At a later time when the metadata task was retried and successful it was unskipped and the video was downloaded. These sort of issues are relatively common and one of the reasons tasks are retried quite a few times before failing permanently.

@irishj
Copy link

irishj commented Nov 24, 2023

Seeing the same issue here today for multiple videos on a playlist.

Playlist: https://www.youtube.com/playlist?list=PLJtPH8t_isfVo8JMCfpm50ZoGWK9XASW6

Examples from the log :

2023-11-24 15:52:21,691 [tubesync/INFO] Media: Scenic Relaxation / 5fRtjrmCYEQ has no published date, marking to be skipped
2023-11-24 15:52:21,714 [tubesync/INFO] Scheduling task to download metadata for: https://www.youtube.com/watch?v=5fRtjrmCYEQ
2023-11-24 15:52:21,741 [tubesync/INFO] Indexed media: Scenic Relaxation / 5fRtjrmCYEQ
2023-11-24 15:52:21,767 [tubesync/INFO] Media: Scenic Relaxation / WsX_SOsgvPI has no published date, marking to be skipped
2023-11-24 15:52:21,790 [tubesync/INFO] Scheduling task to download metadata for: https://www.youtube.com/watch?v=WsX_SOsgvPI
2023-11-24 15:52:21,817 [tubesync/INFO] Indexed media: Scenic Relaxation / WsX_SOsgvPI
2023-11-24 15:52:21,845 [tubesync/INFO] Media: Scenic Relaxation / 2A0OkZ2TnxY has no published date, marking to be skipped
2023-11-24 15:52:21,868 [tubesync/INFO] Scheduling task to download metadata for: https://www.youtube.com/watch?v=2A0OkZ2TnxY
2023-11-24 15:52:21,948 [tubesync/INFO] Indexed media: Scenic Relaxation / 2A0OkZ2TnxY
2023-11-24 15:52:21,992 [tubesync/INFO] Media: Scenic Relaxation / UV704FOSDjg has no published date, marking to be skipped
2023-11-24 15:52:22,028 [tubesync/INFO] Scheduling task to download metadata for: https://www.youtube.com/watch?v=UV704FOSDjg
2023-11-24 15:52:22,083 [tubesync/INFO] Indexed media: Scenic Relaxation / UV704FOSDjg

I also have a playlist which I created myself, where I add videos which I find interesting and want to be downloaded and seeing the same issue there also. The playlist only has one media item currently and a similar error in the logs about the media being skipped. Deleted the installation and re-created and still seeing the same problem. Running the latest version at the time of writing (0.13.2) in a docker container.

@meeb
Copy link
Owner

meeb commented Nov 24, 2023

This error means that the upload_date field in the metadata you received from YouTube was not set. Try skipping then unskipping a media item that failed, this should trigger the metadata to be redownloaded.

@irishj
Copy link

irishj commented Nov 24, 2023

The metadata is downloaded ok, that happened after the message shown in my original post, which I thought was strange as why would the metadata be downloaded if the video was being skipped by the system. Tried resetting the tasks, but the videos still don't download.

2023-11-24 16:42:36,813 [tubesync/DEBUG] [download] Finished downloading playlist: Calming Scenic Videos
2023-11-24 16:42:39,941 [tubesync/INFO] Found 147 media items for source: Scenic Relaxation
2023-11-24 16:42:39,967 [tubesync/INFO] Indexed media: Scenic Relaxation / -QR0w4-nJns
2023-11-24 16:42:39,986 [tubesync/INFO] Indexed media: Scenic Relaxation / hy1PNzwHazE
2023-11-24 16:42:40,004 [tubesync/INFO] Indexed media: Scenic Relaxation / FOvOxeb2TCg
2023-11-24 16:42:40,023 [tubesync/INFO] Indexed media: Scenic Relaxation / czKdZtV5s88
2023-11-24 16:42:40,043 [tubesync/INFO] Indexed media: Scenic Relaxation / eMdFEN1KzjU
2023-11-24 16:42:40,061 [tubesync/INFO] Indexed media: Scenic Relaxation / oYRw02g706M
2023-11-24 16:42:40,084 [tubesync/INFO] Indexed media: Scenic Relaxation / u4NYbhjYpw8
2023-11-24 16:42:40,104 [tubesync/INFO] Indexed media: Scenic Relaxation / KfvmCDX-tdY
2023-11-24 16:42:40,123 [tubesync/INFO] Indexed media: Scenic Relaxation / NVaDzZlSld4
2023-11-24 16:42:40,142 [tubesync/INFO] Indexed media: Scenic Relaxation / AybNYgQi9hY
2023-11-24 16:42:40,162 [tubesync/INFO] Indexed media: Scenic Relaxation / mh6WChUVxOQ
2023-11-24 16:42:40,182 [tubesync/INFO] Indexed media: Scenic Relaxation / hxhi2ttHplw
2023-11-24 16:42:40,202 [tubesync/INFO] Indexed media: Scenic Relaxation / _RZm7E9E-CM
2023-11-24 16:42:40,221 [tubesync/INFO] Indexed media: Scenic Relaxation / lvNRoGr-APE
2023-11-24 16:42:40,240 [tubesync/INFO] Indexed media: Scenic Relaxation / g1QR0RO1pbw
2023-11-24 16:42:40,259 [tubesync/INFO] Indexed media: Scenic Relaxation / 3fFF_yQ0nx8
2023-11-24 16:42:40,287 [tubesync/INFO] Indexed media: Scenic Relaxation / Y5_6LALJ_mc
2023-11-24 16:42:40,306 [tubesync/INFO] Indexed media: Scenic Relaxation / pkQpYG80WAo
2023-11-24 16:42:40,326 [tubesync/INFO] Indexed media: Scenic Relaxation / YDL8HbY9ENU
2023-11-24 16:42:40,346 [tubesync/INFO] Indexed media: Scenic Relaxation / wi08uYZBhRs
2023-11-24 16:42:40,375 [tubesync/INFO] Indexed media: Scenic Relaxation / QipIufCH3rw
2023-11-24 16:42:40,394 [tubesync/INFO] Indexed media: Scenic Relaxation / jqzLjbP4cls
2023-11-24 16:42:40,413 [tubesync/INFO] Indexed media: Scenic Relaxation / jIwyy2D5iag
2023-11-24 16:42:40,432 [tubesync/INFO] Indexed media: Scenic Relaxation / _Om1TGeHCKk
2023-11-24 16:42:40,452 [tubesync/INFO] Indexed media: Scenic Relaxation / FyzlhpMFxok
2023-11-24 16:42:40,471 [tubesync/INFO] Indexed media: Scenic Relaxation / JnaseAj1kME
2023-11-24 16:42:40,490 [tubesync/INFO] Indexed media: Scenic Relaxation / 0n_3Rj2q9_Q
2023-11-24 16:42:40,511 [tubesync/INFO] Indexed media: Scenic Relaxation / xm68tbtPWGg
2023-11-24 16:42:40,531 [tubesync/INFO] Indexed media: Scenic Relaxation / -0F7iua-37Y
2023-11-24 16:42:40,552 [tubesync/INFO] Indexed media: Scenic Relaxation / 5D-fWkQylSQ
2023-11-24 16:42:40,572 [tubesync/INFO] Indexed media: Scenic Relaxation / 1FANIjfPbfo
2023-11-24 16:42:40,594 [tubesync/INFO] Indexed media: Scenic Relaxation / Gf5rSeTKpj4
2023-11-24 16:42:40,613 [tubesync/INFO] Indexed media: Scenic Relaxation / X5xlTpuiRCE
2023-11-24 16:42:40,633 [tubesync/INFO] Indexed media: Scenic Relaxation / EBsnEiDTqEQ
2023-11-24 16:42:40,653 [tubesync/INFO] Indexed media: Scenic Relaxation / 0xhzwDXfLds
2023-11-24 16:42:40,689 [tubesync/INFO] Indexed media: Scenic Relaxation / 6vrbc6cIM8o
2023-11-24 16:42:40,709 [tubesync/INFO] Indexed media: Scenic Relaxation / mBw7vkcQOew
2023-11-24 16:42:40,737 [tubesync/INFO] Indexed media: Scenic Relaxation / F09tnNH2SvY
2023-11-24 16:42:40,762 [tubesync/INFO] Indexed media: Scenic Relaxation / jpZaVpjWbbI
2023-11-24 16:42:40,782 [tubesync/INFO] Indexed media: Scenic Relaxation / y13JsbpHaT4
2023-11-24 16:42:40,807 [tubesync/INFO] Indexed media: Scenic Relaxation / MpiHQUCT1Cc
2023-11-24 16:42:40,826 [tubesync/INFO] Indexed media: Scenic Relaxation / Y1SH7C6eOMY
2023-11-24 16:42:40,845 [tubesync/INFO] Indexed media: Scenic Relaxation / uzA8Y6xcuAs
2023-11-24 16:42:40,864 [tubesync/INFO] Indexed media: Scenic Relaxation / hMMnnYX_y28
2023-11-24 16:42:40,883 [tubesync/INFO] Indexed media: Scenic Relaxation / 4W61GqRttNY
2023-11-24 16:42:40,902 [tubesync/INFO] Indexed media: Scenic Relaxation / fyOVKyaKJq4
2023-11-24 16:42:40,922 [tubesync/INFO] Indexed media: Scenic Relaxation / AJV6uXGu70Y
2023-11-24 16:42:40,945 [tubesync/INFO] Indexed media: Scenic Relaxation / DEAcPVg8V7U
2023-11-24 16:42:40,965 [tubesync/INFO] Indexed media: Scenic Relaxation / rkpzYNB6xks
2023-11-24 16:42:40,984 [tubesync/INFO] Indexed media: Scenic Relaxation / b_jkVx4wyrE
2023-11-24 16:42:41,004 [tubesync/INFO] Indexed media: Scenic Relaxation / k2-LUK_vmOA
2023-11-24 16:42:41,026 [tubesync/INFO] Indexed media: Scenic Relaxation / zleIaEIBs2M
2023-11-24 16:42:41,046 [tubesync/INFO] Indexed media: Scenic Relaxation / Bxo2JkiqG_o
2023-11-24 16:42:41,066 [tubesync/INFO] Indexed media: Scenic Relaxation / dR-BW-alOF4
2023-11-24 16:42:41,085 [tubesync/INFO] Indexed media: Scenic Relaxation / KaR9dldHHvE
2023-11-24 16:42:41,104 [tubesync/INFO] Indexed media: Scenic Relaxation / n9LgeoJE4EI
2023-11-24 16:42:41,123 [tubesync/INFO] Indexed media: Scenic Relaxation / DsXMR7dY35w
2023-11-24 16:42:41,142 [tubesync/INFO] Indexed media: Scenic Relaxation / vtxVK3sbZ0o
2023-11-24 16:42:41,170 [tubesync/INFO] Indexed media: Scenic Relaxation / tHztN9inrOw
2023-11-24 16:42:41,188 [tubesync/INFO] Indexed media: Scenic Relaxation / qqJws-fmGsk
2023-11-24 16:42:41,208 [tubesync/INFO] Indexed media: Scenic Relaxation / 9rz91N8kmKw
2023-11-24 16:42:41,233 [tubesync/INFO] Indexed media: Scenic Relaxation / lzjruXO0Fvc
2023-11-24 16:42:41,252 [tubesync/INFO] Indexed media: Scenic Relaxation / lOoPbtb73PU
2023-11-24 16:42:41,271 [tubesync/INFO] Indexed media: Scenic Relaxation / nECRowi6YFs
2023-11-24 16:42:41,291 [tubesync/INFO] Indexed media: Scenic Relaxation / lN2jPHG9dUU
2023-11-24 16:42:41,310 [tubesync/INFO] Indexed media: Scenic Relaxation / D48T0wNm96w
2023-11-24 16:42:41,329 [tubesync/INFO] Indexed media: Scenic Relaxation / J2NGbj0i-7U
2023-11-24 16:42:41,348 [tubesync/INFO] Indexed media: Scenic Relaxation / fTn-XfauCPI
2023-11-24 16:42:41,373 [tubesync/INFO] Indexed media: Scenic Relaxation / H4tyzzP33Cw
2023-11-24 16:42:41,391 [tubesync/INFO] Indexed media: Scenic Relaxation / YbUkAJHCgd0
2023-11-24 16:42:41,411 [tubesync/INFO] Indexed media: Scenic Relaxation / P8frC_cLLD4
2023-11-24 16:42:41,429 [tubesync/INFO] Indexed media: Scenic Relaxation / NGoCQ3HyxQs
2023-11-24 16:42:41,451 [tubesync/INFO] Indexed media: Scenic Relaxation / ZWH5pklwHGc
2023-11-24 16:42:41,470 [tubesync/INFO] Indexed media: Scenic Relaxation / 6K0sajMdAnk
2023-11-24 16:42:41,489 [tubesync/INFO] Indexed media: Scenic Relaxation / XcdmnfFx6iY
2023-11-24 16:42:41,508 [tubesync/INFO] Indexed media: Scenic Relaxation / mLNy7qnpOBo
2023-11-24 16:42:41,528 [tubesync/INFO] Indexed media: Scenic Relaxation / eoTpdTU8nTA
2023-11-24 16:42:41,546 [tubesync/INFO] Indexed media: Scenic Relaxation / gGCwgCe3WtQ
2023-11-24 16:42:41,565 [tubesync/INFO] Indexed media: Scenic Relaxation / VVsC2fD1BjA
2023-11-24 16:42:41,589 [tubesync/INFO] Indexed media: Scenic Relaxation / NHo_x7aGGmU
2023-11-24 16:42:41,609 [tubesync/INFO] Indexed media: Scenic Relaxation / BTMjD7_evjE
2023-11-24 16:42:41,628 [tubesync/INFO] Indexed media: Scenic Relaxation / GRde7WGScrM
2023-11-24 16:42:41,646 [tubesync/INFO] Indexed media: Scenic Relaxation / -bWVoyw9OU8
2023-11-24 16:42:41,672 [tubesync/INFO] Indexed media: Scenic Relaxation / VzqWO5EaSps
2023-11-24 16:42:41,692 [tubesync/INFO] Indexed media: Scenic Relaxation / -s0vUJamgEw
2023-11-24 16:42:41,711 [tubesync/INFO] Indexed media: Scenic Relaxation / 6R8C8BSdMds
2023-11-24 16:42:41,731 [tubesync/INFO] Indexed media: Scenic Relaxation / pb-j3svRQLI
2023-11-24 16:42:41,750 [tubesync/INFO] Indexed media: Scenic Relaxation / 4OiXfDdbtnM
2023-11-24 16:42:41,770 [tubesync/INFO] Indexed media: Scenic Relaxation / 2b2gJu-g3qE
2023-11-24 16:42:41,789 [tubesync/INFO] Indexed media: Scenic Relaxation / 7IBzc3pajzY
2023-11-24 16:42:41,811 [tubesync/INFO] Indexed media: Scenic Relaxation / 6KL2QZ91kAM
2023-11-24 16:42:41,831 [tubesync/INFO] Indexed media: Scenic Relaxation / KfjIaEP0EtY
2023-11-24 16:42:41,851 [tubesync/INFO] Indexed media: Scenic Relaxation / vvm8b2jAfv0
2023-11-24 16:42:41,869 [tubesync/INFO] Indexed media: Scenic Relaxation / OfO6zxvhtBg
2023-11-24 16:42:41,894 [tubesync/INFO] Indexed media: Scenic Relaxation / 1PTs1mqrToM
2023-11-24 16:42:41,915 [tubesync/INFO] Indexed media: Scenic Relaxation / koHbfzwLGC8
2023-11-24 16:42:41,940 [tubesync/INFO] Indexed media: Scenic Relaxation / l8vnE91bV0U
2023-11-24 16:42:41,961 [tubesync/INFO] Indexed media: Scenic Relaxation / ejUuYrSXwP8
2023-11-24 16:42:41,980 [tubesync/INFO] Indexed media: Scenic Relaxation / wFijCHeNW6w
2023-11-24 16:42:41,999 [tubesync/INFO] Indexed media: Scenic Relaxation / _K-Gtb_ywfg
2023-11-24 16:42:42,019 [tubesync/INFO] Indexed media: Scenic Relaxation / fXJVgeFhF4U
2023-11-24 16:42:42,043 [tubesync/INFO] Indexed media: Scenic Relaxation / quVkPi1a_7I
2023-11-24 16:42:42,065 [tubesync/INFO] Indexed media: Scenic Relaxation / Ee0Qh_nIoHw
2023-11-24 16:42:42,085 [tubesync/INFO] Indexed media: Scenic Relaxation / qbte52zuetE
2023-11-24 16:42:42,107 [tubesync/INFO] Indexed media: Scenic Relaxation / oHdecbMrcbI
2023-11-24 16:42:42,127 [tubesync/INFO] Indexed media: Scenic Relaxation / 4Z9mUjtFJYY
2023-11-24 16:42:42,147 [tubesync/INFO] Indexed media: Scenic Relaxation / ZIb8u6uJwBo
2023-11-24 16:42:42,166 [tubesync/INFO] Indexed media: Scenic Relaxation / ifVVc8xTas0
2023-11-24 16:42:42,185 [tubesync/INFO] Indexed media: Scenic Relaxation / bQmzk05I3nw
2023-11-24 16:42:42,205 [tubesync/INFO] Indexed media: Scenic Relaxation / ycDLfQ1Cv_Y
2023-11-24 16:42:42,223 [tubesync/INFO] Indexed media: Scenic Relaxation / Bdh_hF08U9o
2023-11-24 16:42:42,246 [tubesync/INFO] Indexed media: Scenic Relaxation / 2_kAzyaX7SU
2023-11-24 16:42:42,266 [tubesync/INFO] Indexed media: Scenic Relaxation / WsCCYv2adkM
2023-11-24 16:42:42,285 [tubesync/INFO] Indexed media: Scenic Relaxation / gghgYaYeG_M
2023-11-24 16:42:42,305 [tubesync/INFO] Indexed media: Scenic Relaxation / RSRKFAmfqnI
2023-11-24 16:42:42,327 [tubesync/INFO] Indexed media: Scenic Relaxation / -00PZ3FaHV4
2023-11-24 16:42:42,346 [tubesync/INFO] Indexed media: Scenic Relaxation / kVxTrhojpFI
2023-11-24 16:42:42,366 [tubesync/INFO] Indexed media: Scenic Relaxation / zj7kdnWVOxc
2023-11-24 16:42:42,385 [tubesync/INFO] Indexed media: Scenic Relaxation / TIBx3w3loMY
2023-11-24 16:42:42,405 [tubesync/INFO] Indexed media: Scenic Relaxation / rR-1KlR6FtI
2023-11-24 16:42:42,428 [tubesync/INFO] Indexed media: Scenic Relaxation / 5K3Jdux_DDg
2023-11-24 16:42:42,453 [tubesync/INFO] Indexed media: Scenic Relaxation / rzr0W1l98Rw
2023-11-24 16:42:42,473 [tubesync/INFO] Indexed media: Scenic Relaxation / li-_BLtq58w
2023-11-24 16:42:42,493 [tubesync/INFO] Indexed media: Scenic Relaxation / lyh2kAjcmSY
2023-11-24 16:42:42,513 [tubesync/INFO] Indexed media: Scenic Relaxation / 62bWUYRxi8g
2023-11-24 16:42:42,537 [tubesync/INFO] Indexed media: Scenic Relaxation / D7SlK16o82o
2023-11-24 16:42:42,557 [tubesync/INFO] Indexed media: Scenic Relaxation / 6lxg0NKZjOE
2023-11-24 16:42:42,577 [tubesync/INFO] Indexed media: Scenic Relaxation / Pbzn79TSRO0
2023-11-24 16:42:42,596 [tubesync/INFO] Indexed media: Scenic Relaxation / CxwJrzEdw1U
2023-11-24 16:42:42,616 [tubesync/INFO] Indexed media: Scenic Relaxation / YGAsG6_JgAI
2023-11-24 16:42:42,644 [tubesync/INFO] Indexed media: Scenic Relaxation / MxcJtLbIhvs
2023-11-24 16:42:42,669 [tubesync/INFO] Indexed media: Scenic Relaxation / LQuLAbG62vY
2023-11-24 16:42:42,689 [tubesync/INFO] Indexed media: Scenic Relaxation / Mc7XKiNrHQc
2023-11-24 16:42:42,708 [tubesync/INFO] Indexed media: Scenic Relaxation / 3PZ65s2qLTE
2023-11-24 16:42:42,727 [tubesync/INFO] Indexed media: Scenic Relaxation / xl4c2yAVAd4
2023-11-24 16:42:42,751 [tubesync/INFO] Indexed media: Scenic Relaxation / f5rZ6VYHAgo
2023-11-24 16:42:42,770 [tubesync/INFO] Indexed media: Scenic Relaxation / l4VEQpBcOgA
2023-11-24 16:42:42,791 [tubesync/INFO] Indexed media: Scenic Relaxation / XkRFSnxXQ_w
2023-11-24 16:42:42,810 [tubesync/INFO] Indexed media: Scenic Relaxation / np2fnDmvnfQ
2023-11-24 16:42:42,829 [tubesync/INFO] Indexed media: Scenic Relaxation / FlEoW0H-CKQ
2023-11-24 16:42:42,849 [tubesync/INFO] Indexed media: Scenic Relaxation / VukLV0AoeFA
2023-11-24 16:42:42,880 [tubesync/INFO] Indexed media: Scenic Relaxation / sdheM2I3Rgg
2023-11-24 16:42:42,899 [tubesync/INFO] Indexed media: Scenic Relaxation / Yrm0UCCipU0
2023-11-24 16:42:42,918 [tubesync/INFO] Indexed media: Scenic Relaxation / 5fRtjrmCYEQ
2023-11-24 16:42:42,944 [tubesync/INFO] Indexed media: Scenic Relaxation / WsX_SOsgvPI
2023-11-24 16:42:42,964 [tubesync/INFO] Indexed media: Scenic Relaxation / 2A0OkZ2TnxY
2023-11-24 16:42:42,983 [tubesync/INFO] Indexed media: Scenic Relaxation / UV704FOSDjg
2023-11-24 16:42:42,983 [tubesync/INFO] Deleting completed tasks older than 7 days (run_at before 2023-11-17 16:42:42.983236+00:00)

If I manually skip and then unskip a video, it starts to download.

Q1: Is there a way to do this for all the skipped media, such as command line argument ? ( would take a very long time to do this manually for each video)

Q2: Is there a way to add a source and specify to download the media even if there is no "upload_date" in the metadata ?

Thanks for the prompt reply and the great software !

@meeb
Copy link
Owner

meeb commented Nov 24, 2023

You can use the reset-metadata command line command to delete and re-download the metadata for every media item you've indexed. This will reset metadata for all media items though so be careful. This should do what you want though.

Currently the upload_date is required - there's no way for TubeSync to be able to check against any download time limits without it.

@irishj
Copy link

irishj commented Nov 24, 2023

Unfortunately it still didn't download the videos, it downloaded the metadata again, but skipped the videos.

  • edit *

I worked around the issue by running the following query on the database I'm using (MySQL).

UPDATE sync_media SET skip='0';

Reset the tasks and now they are downloading. Would be nice if there was any easier method to perform this type of action, such as an override button for all media which is in a "skipped" state.

@hunterpankey
Copy link

hunterpankey commented Nov 28, 2023

This error means that the upload_date field in the metadata you received from YouTube was not set. Try skipping then unskipping a media item that failed, this should trigger the metadata to be redownloaded.

I've got basically the same issue where no video will be downloaded at all unless I manually skip and unskip. I do seem to have valid, or at least, present "upload_date" members in the JSON, as when I look at the JSON file for videos that I've coerced into downloading, I see things like:
image

That's not exactly what I would expect to see in that field, but it does seem to be a date. Is the code looking for ISO 8601 standard or something?

I feel like manually skipping and unskipping every video isn't really a tenable solution. What can I do to debug the issue and see why metadata is coming down the wire without a valid publish date? Things I've tried:

  1. Getting mad about it. (As usual, this didn't work. :D)
  2. Manually skipping/unskipping. (Meh.)
  3. Resetting all tasks. (No change, still skips everything.)
  4. Changing various keep dates and settings around age checking.

I went looking at code, and I'm not very skilled with Python or Django, but in tubesync/sync/tasks.py:245, it uses timezone.make_aware() to set up the published member which is what's checked later on. If an upload_date shows up with only "20230611" by itself, will that result in anything usable? Later, the check on line 264 does isinstance(media.published, datetime), so if the previous stuff is mad about the string not being in ISO 8601, that's where the failure is.

Any ideas?

@meeb
Copy link
Owner

meeb commented Nov 29, 2023

@hunterpankey the actual date parsing of the string into a datetime object is here:

https://github.com/meeb/tubesync/blob/main/tubesync/sync/models.py#L1088

timezone.make_aware(...) is just a Django helper utility that makes an existing datetime object timezone aware with your locally set timezone. Your screenshotted upload date of 20230611 in the metadata looks perfectly valid to me. As a test, can you open a Python shell in your tubesync project inside the container:

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

Then in the Python shell enter the following test code (my example is using UTC as a test timezone, your timezone should be whatever your TZ env var is set to):

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from datetime import datetime
>>> from django.utils import timezone
>>> example_upload_date = '20230611'
>>> dt = datetime.strptime(example_upload_date, '%Y%m%d')
>>> timezone.make_aware(dt)
datetime.datetime(2023, 6, 11, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='UTC'))

@hunterpankey
Copy link

@hunterpankey the actual date parsing of the string into a datetime object is here:

https://github.com/meeb/tubesync/blob/main/tubesync/sync/models.py#L1088

timezone.make_aware(...) is just a Django helper utility that makes an existing datetime object timezone aware with your locally set timezone. Your screenshotted upload date of 20230611 in the metadata looks perfectly valid to me. As a test, can you open a Python shell in your tubesync project inside the container:

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

Then in the Python shell enter the following test code (my example is using UTC as a test timezone, your timezone should be whatever your TZ env var is set to):

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from datetime import datetime
>>> from django.utils import timezone
>>> example_upload_date = '20230611'
>>> dt = datetime.strptime(example_upload_date, '%Y%m%d')
>>> timezone.make_aware(dt)
datetime.datetime(2023, 6, 11, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='UTC'))

Same results, basically. It's parsing ok, and make_aware() looks like it's doing things properly. In my fumbling, I tried to log the date when it outputs the message, but I don't know enough about either docker, python, or django to get it to restart properly and inadvertently reset all my sources which took a couple of hours to clear all the tasks.

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from datetime import datetime
>>> from django.utils import timezone
>>> example = '20230611'
>>> dt = datetime.strptime(example, '%Y%m%d')
>>> dt
datetime.datetime(2023, 6, 11, 0, 0)
>>> timezone.make_aware(dt)
datetime.datetime(2023, 6, 11, 0, 0, tzinfo=<DstTzInfo 'America/New_York' EDT-1 day, 20:00:00 DST>)```

@meeb
Copy link
Owner

meeb commented Nov 29, 2023

Well that's certainly weird. Once your tasks have all caught up find the UUID of the media item that says it has no upload date (browse to it on the web interface and you can nick the UUID from the URL like http://tubesynchost:4848/media/21882d36-7cfe-4ac2-8d86-537125417349 ) then try this in a shell instead (obviously replacing with your media items UUID):

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

Then:

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from sync.models import Media
>>> from django.utils import timezone
>>> media_item = Media.objects.get(uuid='21882d36-7cfe-4ac2-8d86-537125417349')
>>> media_item.upload_date
datetime.datetime(2023, 11, 27, 0, 0)
>>> timezone.make_aware(media_item.upload_date)
datetime.datetime(2023, 11, 27, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='UTC'))

If that works I'm going to be running low on ideas, also as to why skipping then unskipping works if the upload_date is set properly both before and after refreshing the metadata.

@hunterpankey
Copy link

Oh, I can't get any media to download normally, 0%. The only things that ever download are the ones I manually skip and then unskip, so I don't think the issue is with the metadata. Anyway, I'll give this a shot and see what happens with a specific UUID. Thanks for the help!

@meeb
Copy link
Owner

meeb commented Nov 29, 2023

This really doesn't seem like a complicated issue so if we can get it debugged with your install then a patch should be quite trivial to fix it.

@hunterpankey
Copy link

This really doesn't seem like a complicated issue so if we can get it debugged with your install then a patch should be quite trivial to fix it.

It's so weird! Everything looks like it should. I was expecting to see an empty date in here, but it looks normal! (I included the YouTube ID in case you wanted to see the metadata for yourself.)

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from sync.models import Media
>>> from django.utils import timezone
>>> media_item = Media.objects.get(uuid='b2625b71-2964-41f6-8049-eb93d158a910')
>>> media_item
<Media: p0R6Y-QJt1g>
>>> media_item.upload_date
datetime.datetime(2022, 3, 10, 0, 0)
>>> timezone.make_aware(media_item.upload_date)
datetime.datetime(2022, 3, 10, 0, 0, tzinfo=<DstTzInfo 'America/New_York' EST-1 day, 19:00:00 STD>)

@meeb
Copy link
Owner

meeb commented Nov 29, 2023

And that video when being downloaded errors with upload_date not set?

@meeb
Copy link
Owner

meeb commented Nov 29, 2023

Hm, that's not quite what the task does actually, can you try this as well:

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from sync.models import Media
>>> from common.utils import json_serial
>>> media_item = Media.objects.get(uuid='b2625b71-2964-41f6-8049-eb93d158a910')
>>> metadata = media.index_metadata()
>>> metadata
{... lots of spam ... }
>>> media.metadata = json.dumps(metadata, default=json_serial)
>>> media_item.upload_date
datetime.datetime(2023, 11, 27, 0, 0)
>>> timezone.make_aware(media_item.upload_date)
datetime.datetime(2023, 11, 27, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='UTC'))

@hunterpankey
Copy link

Hm, that's not quite what the task does actually, can you try this as well:

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from sync.models import Media
>>> from common.utils import json_serial
>>> media_item = Media.objects.get(uuid='b2625b71-2964-41f6-8049-eb93d158a910')
>>> metadata = media.index_metadata()
>>> metadata
{... lots of spam ... }
>>> media.metadata = json.dumps(metadata, default=json_serial)
>>> media_item.upload_date
datetime.datetime(2023, 11, 27, 0, 0)
>>> timezone.make_aware(media_item.upload_date)
datetime.datetime(2023, 11, 27, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='UTC'))

Looks like I don't have "json" in scope for the "json.dumps()" line. Where can I import that from?

@hunterpankey
Copy link

Hm, that's not quite what the task does actually, can you try this as well:

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from sync.models import Media
>>> from common.utils import json_serial
>>> media_item = Media.objects.get(uuid='b2625b71-2964-41f6-8049-eb93d158a910')
>>> metadata = media.index_metadata()
>>> metadata
{... lots of spam ... }
>>> media.metadata = json.dumps(metadata, default=json_serial)
>>> media_item.upload_date
datetime.datetime(2023, 11, 27, 0, 0)
>>> timezone.make_aware(media_item.upload_date)
datetime.datetime(2023, 11, 27, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='UTC'))

OK, got it together with an extra import json. It still looks like things are happening correctly.

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from sync.models import Media
>>> from common.utils import json_serial
>>> import json
>>> from django.utils import timezone
>>> media_item = Media.objects.get(uuid='b2625b71-2964-41f6-8049-eb93d158a910')
>>> metadata = media_item.index_metadata()
2023-11-29 10:24:30,866 [tubesync/DEBUG] [youtube] Extracting URL: https://www.youtube.com/watch?v=p0R6Y-QJt1g
2023-11-29 10:24:30,866 [tubesync/DEBUG] [youtube] p0R6Y-QJt1g: Downloading webpage
2023-11-29 10:24:31,581 [tubesync/DEBUG] [youtube] p0R6Y-QJt1g: Downloading ios player API JSON
2023-11-29 10:24:31,737 [tubesync/DEBUG] [youtube] p0R6Y-QJt1g: Downloading android player API JSON
2023-11-29 10:24:32,155 [tubesync/DEBUG] [youtube] p0R6Y-QJt1g: Downloading m3u8 information
>>> metadata
{... lots of spam, indeed! ...}
>>> media_item.metadata = json.dumps(metadata, default=json_serial)
>>> media_item.upload_date
datetime.datetime(2022, 3, 10, 0, 0)
>>> timezone.make_aware(media_item.upload_date)
datetime.datetime(2022, 3, 10, 0, 0, tzinfo=<DstTzInfo 'America/New_York' EST-1 day, 19:00:00 STD>)

@meeb
Copy link
Owner

meeb commented Nov 30, 2023

@hunterpankey this turned out to be a race condition with the handling of metadata. It should be fixed in the latest release.

@meeb meeb closed this as completed Nov 30, 2023
@hunterpankey
Copy link

@hunterpankey this turned out to be a race condition with the handling of metadata. It should be fixed in the latest release.

Good solve! I'll pull the latest and confirm.

@hunterpankey
Copy link

Yep, looking good. Thanks for the quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants