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

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 this issue Jun 2, 2024 · 15 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@holta
Copy link
Member

holta commented Jun 2, 2024

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 holta added the bug Something isn't working label Jun 2, 2024
@holta
Copy link
Member Author

holta commented Jun 3, 2024

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

@holta
Copy link
Member Author

holta commented Jun 3, 2024

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

https://www.youtube.com/watch?v=zOHi37jWcro
https://www.youtube.com/watch?v=xQpImggreLE
https://www.youtube.com/@iogacademy/playlists 297 videos in this channel,download failed ❌
https://www.youtube.com/watch?v=5WenPx1krGE&t=90s✅
https://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
Copy link
Collaborator

deldesir commented Jun 4, 2024

Explanations of errors:

  • (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.

  • (2) 'NoneType' object is not subscriptable: this means the video file was not found. It might a premature check for the file or a failure on xklb side to process the file.

  • (3) Download appears to be stuck: a timeout issue experienced during the download process. Will be strengthened to avoid false positives.

@nzola
Copy link

nzola commented Jun 4, 2024

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
Copy link
Member Author

holta commented Jun 4, 2024

@nzola

You've pasted in the wrong iiab-diagnostics:

  • https://dpaste.com/BGKGBZK7G shows a PC CPU, rather than a Raspberry Pi CPU.

  • Please run iiab-diagnostics on the Raspberry Pi 4 and post the resulting URL (a dpaste.com pastebin) to this ticket when you can, Thanks!

@nzola
Copy link

nzola commented Jun 5, 2024

@nzola

You've pasted in the wrong iiab-diagnostics:

@holta
Copy link
Member Author

holta commented Jun 5, 2024

  • (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:

  • Videos are hidden from and disappear from YouTube regularly / eternally for a variety of different reasons, consequently...
  • IIAB Teachers expect and deserve IIAB Calibre-Web "Tasks" view to show a "Googlable" (or very friendly!!) message explaining exactly what they should try next~

🎨

@holta holta added the help wanted Extra attention is needed label Jun 5, 2024
@deldesir
Copy link
Collaborator

deldesir commented Jun 5, 2024

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
Copy link
Member Author

holta commented Jun 5, 2024

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

  • Let's gather all such/similar reproducible cases. As much as we can in coming weeks. ✊

  • And stress test these during our move to Ruff-based CI (GitHub Actions), while gradually increasing static type-checking of Python variables!

@holta
Copy link
Member Author

holta commented Jun 10, 2024

@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
Copy link
Collaborator

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

@holta
Copy link
Member Author

holta commented Jun 10, 2024

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
Copy link
Member Author

holta commented Jun 10, 2024

@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!)

@holta
Copy link
Member Author

holta commented Jun 11, 2024

@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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants