tubesync
tubesync copied to clipboard
Precondition check failed
Is this currently working? I'm seeing errors like:
2024-03-01 22:42:38,899 [tubesync/WARNING] [youtube] YouTube said: ERROR - Precondition check failed.
2024-03-01 22:42:38,900 [tubesync/WARNING] [youtube] HTTP Error 400: Bad Request. Retrying (1/3)...
That's an error directly from yt-dlp talking to YouTube and not really anything to do with tubesync. Make sure you're running the latest release, if you are I'd suggest trying some yt-dlp commands directly to debug it.
Thanks!
I have the same problem (tried both the latest and v0.13.4 tags).
I understand this is caused by this issue: https://github.com/yt-dlp/yt-dlp/issues/9316
It was solved and the new yt-dlp was released on the 28th, while the docker image is from the 27th.
I understand that updating yt-dlp to the newest version would fix the issue, am I correct?
Is it possible to update the yt-dlp inside the container, or should I just wait for the new docker image?
As a side note - would it be possible to create a container startup task that would execute something like "yt-dlp --update", so yt-dlp is always up to date, even if a new image was not released yet?
yt-dlp is currently up to date in the container, the latest official release is 2023.12.30 which is what is currently bundled into tubesync. The issue you've linked has a fix in nightlies and not in the current official release. Once it's in an official release I'll update tubesync so yes waiting for a container update would be the most sensible option.
I generally don't to do something like yt-dlp --update on start in the container as this makes the container mutable and allows for different people to be running different versions of yt-dlp.
Thanks for the explanation.
Oh, and by the way thanks for the nice project and the time you're spending developing it.
Is there a way to update to the nightly build to test the update while we wait for it to be added to the stable channel?
Well, you can drop into the container and run whatever update commands you like with:
$ docker exec -ti tubesync bash
$ yt-dlp --update ... blah ...
You'll probably need to manually specify the dev / nightly build to get that to work though. Also that will be reset once the latest container is released.
I had tried that, and i tried with python3 pip commands as well, no luck. I thought you may have a better idea of the command needed.
root@d963562b4185:/app# yt-dlp --update-to bashonly/yt-dlp@bump WARNING: You are switching to an unofficial executable from bashonly/yt-dlp. Run at your own risk Current version: [email protected] from yt-dlp/yt-dlp Requested version: bashonly/yt-dlp@bump build 2024.02.28.155832 ERROR: You installed yt-dlp with pip or using the wheel from PyPi; Use that to update
You probably need to use pipenv then, apt update && apt install pipenv, then pipenv install setuptools, then install yt-dlp ... something ...
Pretty sure you can use pipenv install git+path-to-fork-on-github and it'll work, although I've not tested it myself.
Thanks @meeb, I will work with that in the morning and see if i can get it to work.
Np. Oh and make sure you execute the pipenv commands in the /app directory.
I was able to do it like this:
root@d963562b4185:/app# pipenv shell
Creating a virtualenv for this project...
Pipfile: /app/Pipfile
Using /usr/bin/python3 (3.11.2) to create virtualenv...
⠏ Creating virtual environment...created virtual environment CPython3.11.2.final.0-64 in 515ms
creator CPython3Posix(dest=/root/.local/share/virtualenvs/app-4PlAip0Q, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
added seed packages: pip==23.0.1, setuptools==66.1.1, wheel==0.38.4
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
✔ Successfully created virtual environment!
Virtualenv location: /root/.local/share/virtualenvs/app-4PlAip0Q
Creating a Pipfile for this project...
Launching subshell in virtual environment...
root@d963562b4185:/app# . /root/.local/share/virtualenvs/app-4PlAip0Q/bin/activate
(app) root@d963562b4185:/app# yt-dlp --version
2023.12.30
(app) root@d963562b4185:/app# python3 -m pip install -U --pre yt-dlp nightly
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting yt-dlp nightly
Downloading https://www.piwheels.org/simple/yt-dlp/yt_dlp-2024.3.7.232716.dev0-py3-none-any.whl (3.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 2.8 MB/s eta 0:00:00
Installing collected packages: brotli, websockets, urllib3, pycryptodomex, mutagen, idna, charset-normalizer, certifi, requests, yt-dlp
Successfully installed brotli-1.1.0 certifi-2024.2.2 charset-normalizer-3.3.2 idna-3.6 mutagen-1.47.0 pycryptodomex-3.20.0 requests-2.31.0 urllib3-2.2.1 websockets-12.0 yt-dlp-2024.3.7.232716.dev0
(app) root@d963562b4185:/usr/local/bin# yt-dlp --version
2023.12.30
I had to exit and re-enter to see that the version was different
(app) root@d963562b4185:/app# yt-dlp --version
2024.03.07.232716
Thanks for the detailed steps! Hopefully this will be fixed in the main release soon but this is useful for anyone else wanting to run nightlies in the interim.
I am seeing that i still see the same problem with the nightly version of yt-dlp, that others saw is fixed. But it looks like they are also using a cookies parm. Any way i can see what command is being executed? Would like to see if it matches to the yt-dlp issuie above or if its something different, that should be raised.
Error is still see:
2024-03-10 12:31:21,482 [tubesync/INFO] Saved 83949 bytes of metadata for: robocarpoli / 4627f57a-6bdd-484b-94ea-2bfdd2bf70cb 2024-03-10 12:31:23,407 [tubesync/WARNING] [youtube] YouTube said: ERROR - Precondition check failed. 2024-03-10 12:31:23,407 [tubesync/WARNING] [youtube] HTTP Error 400: Bad Request. Retrying (1/3)... 2024-03-10 12:31:23,571 [tubesync/WARNING] [youtube] YouTube said: ERROR - Precondition check failed. 2024-03-10 12:31:23,571 [tubesync/WARNING] [youtube] HTTP Error 400: Bad Request. Retrying (2/3)... 2024-03-10 12:31:23,616 [tubesync/WARNING] [youtube] YouTube said: ERROR - Precondition check failed. 2024-03-10 12:31:23,616 [tubesync/WARNING] [youtube] HTTP Error 400: Bad Request. Retrying (3/3)... 2024-03-10 12:31:23,726 [tubesync/WARNING] [youtube] YouTube said: ERROR - Precondition check failed. 2024-03-10 12:31:23,728 [tubesync/WARNING] [youtube] Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U 2024-03-10 12:31:25,240 [tubesync/INFO] Scheduling task to download thumbnail for: Make friends | Robocar Poli Clips from: https://i.ytimg.com/vi_webp/-e5q1VpcUwk/maxresdefault.webp 2024-03-10 12:31:25,262 [tubesync/INFO] Saved 351797 bytes of metadata for: robocarpoli / 34a4ad2c-fe9c-485c-b5b4-ae2858658d8a 2024-03-10 12:31:28,942 [tubesync/WARNING] [youtube] YouTube said: ERROR - Precondition check failed. 2024-03-10 12:31:28,943 [tubesync/WARNING] [youtube] HTTP Error 400: Bad Request. Retrying (1/3)... 2024-03-10 12:31:29,087 [tubesync/WARNING] [youtube] YouTube said: ERROR - Precondition check failed. 2024-03-10 12:31:29,088 [tubesync/WARNING] [youtube] HTTP Error 400: Bad Request. Retrying (2/3)... 2024-03-10 12:31:29,127 [tubesync/WARNING] [youtube] YouTube said: ERROR - Precondition check failed. 2024-03-10 12:31:29,127 [tubesync/WARNING] [youtube] HTTP Error 400: Bad Request. Retrying (3/3)... 2024-03-10 12:31:29,494 [tubesync/WARNING] [youtube] YouTube said: ERROR - Precondition check failed. 2024-03-10 12:31:29,495 [tubesync/WARNING] [youtube] Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>); ple
tubesync doesn't execute yt-dlp with CLI args, it uses the internal Python API. There's a bunch of args used, some here:
https://github.com/meeb/tubesync/blob/main/tubesync/sync/youtube.py#L140
and the defaults here:
https://github.com/meeb/tubesync/blob/main/tubesync/tubesync/settings.py#L158
Given this seems to be an issue yt-dlp are working on I'm not going to spend much time on this myself and just pull in whatever fix the upstream devs release.
Ah, there was a yt-dlp release a few hours ago. I'll pull that in shortly.
tubesync doesn't execute
yt-dlpwith CLI args, it uses the internal Python API. There's a bunch of args used, some here:https://github.com/meeb/tubesync/blob/main/tubesync/sync/youtube.py#L140
and the defaults here:
https://github.com/meeb/tubesync/blob/main/tubesync/tubesync/settings.py#L158
Thanks @meeb! I think thats what i needed to provide the yt-dlp devs what they would need.
I have added your comments on: https://github.com/yt-dlp/yt-dlp/issues/9316
and asked them to let me know how i can help/test/validate
Probably not that useful for the upstream devs really, given tubesync is pretty much just a UI wrapper around yt-dlp.
The latest build, v0.13.5, has yt-dlp v2024.03.10 in it. Update and try that.
Thanks! I updated, and i am not seeing the errors posting yet.
This should have been resolved a while go so I'll close the issue for now.