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

Error: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #982

Open
JamynShanley opened this issue May 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@JamynShanley
Copy link

I believe this configuration has worked for a while, so I'm not sure why it's erroring out now. Log, config, and subscription attached.

config-and-logs.zip

[ytdl-sub] Validating subscriptions...
[ytdl-sub] An uncaught error occurred:
Traceback (most recent call last):
  File "ytdl_sub/main.py", line 29, in main
  File "ytdl_sub/main.py", line 18, in _main
  File "ytdl_sub/cli/entrypoint.py", line 244, in main
  File "ytdl_sub/cli/entrypoint.py", line 107, in _download_subscriptions_from_yaml_files
  File "ytdl_sub/subscriptions/subscription.py", line 155, in from_file_path
  File "ytdl_sub/subscriptions/subscription.py", line 64, in from_dict
  File "ytdl_sub/subscriptions/subscription.py", line 40, in from_preset
  File "ytdl_sub/subscriptions/base_subscription.py", line 78, in __init__
  File "ytdl_sub/subscriptions/base_subscription.py", line 30, in _initialize_download_archive
  File "ytdl_sub/ytdl_additions/enhanced_download_archive.py", line 442, in reinitialize
  File "ytdl_sub/ytdl_additions/enhanced_download_archive.py", line 392, in _maybe_load_download_mappings
  File "ytdl_sub/ytdl_additions/enhanced_download_archive.py", line 173, in from_file
  File "json/__init__.py", line 293, in load
  File "json/__init__.py", line 346, in loads
  File "json/decoder.py", line 337, in decode
  File "json/decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[ytdl-sub] Version 2024.04.28+1d17605
Please upload the error log file '/tmp/ytdl-sub.errors1u74xnz7' and make a Github issue at https://github.com/jmbannon/ytdl-sub/issues with your config and command/subscription yaml file to reproduce. Thanks for trying ytdl-sub!
@JamynShanley
Copy link
Author

JamynShanley commented May 11, 2024

It appears to be choking on an invalid archive file.

[pid 1666426] read(32, "---\n__preset__:\n  preset: \"youtu"..., 8192) = 1005 <0.000008>
[pid 1666426] read(32, "", 8192)        = 0 <0.000006>
[pid 1666426] read(32, "", 8192)        = 0 <0.000007>
[pid 1666426] read(32, "youtube Bh7Xf3Ox7K8\n", 21) = 20 <0.000023>
[pid 1666426] read(32, "", 1)           = 0 <0.000006>
[pid 1666426] write(1, "[ytdl-sub] An uncaught error occ"..., 1239[ytdl-sub] An uncaught error occurred:
$ cat ytdl-sub-Smarter\ Every\ Day-download-archive.json
youtube Bh7Xf3Ox7K8

I'm not sure how it ended up writing a corrupted archive file, but that seems to be the core issue. Bh7Xf3Ox7K8 is a valid youtube video id for the associated channel.

@jmbannon
Copy link
Owner

Yep that is the reason. I think I need to find a way to prevent this, have seen this multiple times now.
For now, try to manually fix it

@jmbannon
Copy link
Owner

Hmm actually, this looks like a yt-dlp archive which is different than a ytdl-sub archive. Not sure how that happened. Unfortunately the best way to proceed is to probably delete the archive and redownload

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

No branches or pull requests

2 participants