ReVanced / restore-missing-youtube-watch-history

⌛ Script to import missing YouTube watch history
https://revanced.app
GNU General Public License v3.0
59 stars 6 forks source link

Unable to download API page: HTTP Error 400 #5

Closed MarcaDian closed 6 months ago

MarcaDian commented 6 months ago

I did everything according to the instructions, but there was an error

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-06 232548

MarcaDian commented 6 months ago
C:\restore-missing-youtube-watch-history-main>python3 -m pip install -U yt-dlp
Requirement already satisfied: yt-dlp in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (2023.12.30)
Requirement already satisfied: mutagen in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from yt-dlp) (1.47.0)
Requirement already satisfied: pycryptodomex in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from yt-dlp) (3.20.0)
Requirement already satisfied: certifi in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from yt-dlp) (2024.2.2)
Requirement already satisfied: requests<3,>=2.31.0 in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from yt-dlp) (2.31.0)
Requirement already satisfied: urllib3<3,>=1.26.17 in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from yt-dlp) (2.2.1)
Requirement already satisfied: websockets>=12.0 in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from yt-dlp) (12.0)
Requirement already satisfied: brotli in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from yt-dlp) (1.1.0)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from requests<3,>=2.31.0->yt-dlp) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in c:\users\tolan\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from requests<3,>=2.31.0->yt-dlp) (3.6)
oSumAtrIX commented 6 months ago

It could be a thing of the sleep values. Try setting them to something higher, report back which values work for you.

MarcaDian commented 6 months ago

no, that doesn't help. maybe someone else will report, maybe I'm unique ¯\_(ツ)

PS C:\restore-missing-youtube-watch-history-main> python main.py --sleep_min 60
Found 10454 videos to watch
Found 10044 videos to watch after de-duplication
0/10044          2023-11-29T11:26:53.871Z        https://www.youtube.com/watch?v=C9KNtAUvNOM     ися відео https://www.youtube.com/watch?v=C9KNtAUvNOM ...  -> Already done
1/10044          2023-11-29T11:26:55.518Z        https://www.youtube.com/watch?v=_3mt-yLX-1U     ися відео https://www.youtube.com/watch?v=_3mt-yLX-1U ...  -> Already done
2/10044          2023-11-29T11:26:57.859Z        https://www.youtube.com/watch?v=1FPomjki6zE     ися відео https://www.youtube.com/watch?v=1FPomjki6zE ...  -> Already done
3/10044          2023-11-29T11:26:59.228Z        https://www.youtube.com/watch?v=f3xYmT6nlBU     ися відео https://www.youtube.com/watch?v=f3xYmT6nlBU ...  -> Already done
4/10044          2023-11-29T11:27:01.018Z        https://www.youtube.com/watch?v=ONdzLUgD8kk     ися відео https://www.youtube.com/watch?v=ONdzLUgD8kk ...  -> Already done
5/10044          2023-11-29T11:27:05.144Z        https://www.youtube.com/watch?v=8OdIukiNbQ8     ися відео https://www.youtube.com/watch?v=8OdIukiNbQ8 ...  -> Already done
6/10044          2023-11-29T11:27:17.394Z        https://www.youtube.com/watch?v=NRymQXwc1H0     ися відео https://www.youtube.com/watch?v=NRymQXwc1H0 ...  -> Already done
7/10044          2023-11-29T11:27:18.489Z        https://www.youtube.com/watch?v=4elQjdAuJTE     ися відео https://www.youtube.com/watch?v=4elQjdAuJTE ... WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (1/3)...
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (2/3)...
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (3/3)...
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
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
 -> Sleeping ...  -> Done
8/10044          2023-11-29T11:27:30.596Z        https://www.youtube.com/watch?v=HvMYIrQlj7c     ися відео https://www.youtube.com/watch?v=HvMYIrQlj7c ... WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (1/3)...
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (2/3)...
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (3/3)...
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.
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
MarcaDian commented 6 months ago

I did a little test. These are shorts with an error in the logs, the shorts appear in the history on You tab, not in the general history. Only full videos are displayed in the general history.

UPD: test python main.py --sleep_min 10

oSumAtrIX commented 6 months ago

If shorts are the issue, this should be fixed now.

MarcaDian commented 6 months ago

python3 -m pip install -U --pre yt-dlp

installing the nightly version of yt-dlp solve the problem

oSumAtrIX commented 6 months ago

Did the latest commit fix it too?

MarcaDian commented 6 months ago

this https://github.com/ReVanced/restore-missing-youtube-watch-history/pull/4 ? No, was same error

oSumAtrIX commented 6 months ago

Try a pre https://github.com/ReVanced/restore-missing-youtube-watch-history/pull/4/commits/6912aef1677ac4cc195db132aee4364cf8c21104 commit