iiab / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
4 stars 5 forks source link

3 kinds of errors on a fresh test: (1) 'NoneType' object cannot be interpreted as an integer (2) 'NoneType' object is not subscriptable (3) Download appears to be stuck #167

Open holta opened 5 months ago

holta commented 5 months ago

Thanks @nzola for having confirmed!

I could only copy 2 videos. Most of them failed. Single videos and playlist. I re-installed multipass and Calibre-Web on my new computer.

IMG-20240602-WA0000~4

holta commented 5 months ago

Possibly related:

holta commented 5 months ago

@nzola clarififies that these were some of the videos he tried above:

holta commented 5 months ago

Thank you @EMG70 for clarifying your own experience testing Nzola's 5 links above!

https://www.youtube.com/watch?v=zOHi37jWcrohttps://www.youtube.com/watch?v=xQpImggreLEhttps://www.youtube.com/@iogacademy/playlists 297 videos in this channel,download failed ❌ https://www.youtube.com/watch?v=5WenPx1krGE&t=90shttps://www.youtube.com/@IohkIo/playlists very long channel of 972 videos.I had to cancel it as it took long to initialize ❌

IMG-20240603-WA0001

deldesir commented 5 months ago

Explanations of errors:

nzola commented 5 months ago

Last night, I successfully upgraded Calibre-Web on a PI4 and run the video playlist "https://www.youtube.com/@IohkIo/playlists", this is the "PUBLISHING TO URL...https://dpaste.com/ELHD529SS", and this is the results I got on the task view and status view: image image

holta commented 5 months ago

@nzola

You've pasted in the wrong iiab-diagnostics:

nzola commented 5 months ago

@nzola

You've pasted in the wrong iiab-diagnostics:

holta commented 5 months ago
  • (1) 'NoneType' object cannot be interpreted as an integer : likely due to a missing metadata field like view_count or duration during the metadata fetching task. Restricted videos will throw this error.

Thanks @deldesir and @EMG70 and @nzola:

Browsing to https://youtu.be/ROgfEuRI6Sw shows:

If the owner of this video has granted you access, please sign in.

While seemingly obvious:

🎨

deldesir commented 5 months ago

You're right. The "NoneType" object can stay in the log file, but the user should see a message explaining what's going on. I'll work on this.

holta commented 5 months ago

Also, a message like "'NoneType' object cannot be interpreted as an integer" strongly indicates that a Python variable type needs validation? 🙃

holta commented 5 months ago

@deldesir

@nzola says that playlist https://www.youtube.com/@iogacademy/playlists still continues to fail to download — does this mean that older playlists with videos that are "unavailable" or "owner of this video has [NOT] granted you access" need more sophisticated handling?

  1. On PC/VM it failed with:

Metadata fetch: https://www.youtube.com/watch?v=V0zV_xO3Yal failed: 'NoneType' object cannot be interpreted as an integer

https://dpaste.com/CDSUG68CD

  1. On RPi 4 it failed with:

Metadata fetch: https://www.youtube.com/watch?v=ROgfEuRI6Sw failed: 'NoneType' object cannot be interpreted as an integer

https://dpaste.com/6V66CQ7NQ

deldesir commented 5 months ago

I see, I'm addressing this with #175 and another PR which will make calculations of views per day failsafe.

holta commented 5 months ago

I see, I'm addressing this with #175

PR #175 is now merged:

and another PR which will make calculations of views per day failsafe.

Great!

holta commented 5 months ago

@nzola says that playlist https://www.youtube.com/@iogacademy/playlists still continues to fail to download — does this mean that older playlists with videos that are "unavailable" or "owner of this video has [NOT] granted you access" need more sophisticated handling?

@deldesir it appears playlists/channels are blocked from downloading if even a single YouTube video is "unavailable" or "owner of this video has [NOT] granted you access".

holta commented 5 months ago

@nzola says that playlist https://www.youtube.com/@iogacademy/playlists still continues to fail to download — does this mean that older playlists with videos that are "unavailable" or "owner of this video has [NOT] granted you access" need more sophisticated handling?

@deldesir it appears playlists/channels are blocked from downloading if even a single YouTube video is "unavailable" or "owner of this video has [NOT] granted you access".

  • Can this strict approach be made more pragmatic — for educators wanting the bulk of the playlist/channel downloaded — even despite a few videos no longer being available?
  • (Instead of blocking the full download!)

@deldesir's PR #179 proposes a solution to this problem, please see: