MichaelBelgium / Youtube-API

A way to host your own API that converts youtube video's to mp3/mp4 and returns a download/stream link and information.
154 stars 49 forks source link

When I convert the video to mp3 I get error #53

Open MC-shark opened 2 weeks ago

MC-shark commented 2 weeks ago

[youtube] 1aL13COq5nM: Sign in to confirm you’re not a bot. This helps protect our community. Learn more


dennorske commented 2 weeks ago

This is due to the new measures Google/Youtube has put in place to avoid bots from accessing and scraping the content from YouTube, sadly, this is an upstream issue with YT-DLP, and not with the YouTube-API

You can read more here: https://github.com/yt-dlp/yt-dlp/issues/10128

MichaelBelgium commented 2 weeks ago

Why Youtube, why ...🤦

This will also affect MichaelBelgium/Laravel-Youtube-API and https://youtube.michaelbelgium.me

MichaelBelgium commented 2 weeks ago

In Laravel-Youtube-API i added the possiblitly to set proxy for yt-dlp/youtube-dl

I could do the same here, as that might be a work around

MC-shark commented 2 weeks ago

在 Laravel-Youtube-API 中,我添加了为 yt-dlp/youtube-dl设置代理的可能性

我可以在这里做同样的事情,因为这可能是一个解决方法

Can the michaelbelgium api be fixed? I want to pay for it

MichaelBelgium commented 2 weeks ago

I did implement a temporary fix, it works most of the time but unsure for how long it'll work. If youtube restrict more its doomed

MC-shark commented 2 weeks ago

Did you fix it because you added a proxy? Why isn't the Youtube-API code updated?

MichaelBelgium commented 2 weeks ago

Yes i use rotating proxy now for youtube.michaelbelgium.me

Op wo 13 nov 2024 08:49 schreef MC-shark @.***>:

Did you fix it because you added a proxy? Why isn't the Youtube-API code updated?

— Reply to this email directly, view it on GitHub https://github.com/MichaelBelgium/Youtube-API/issues/53#issuecomment-2472721653, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEJKBLQEMB6TTLGSFTR5ML2AMAB5AVCNFSM6AAAAABRTBHGL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZSG4ZDCNRVGM . You are receiving this because you commented.Message ID: @.***>

MichaelBelgium commented 2 weeks ago

The code can't fix it, only provide work arounds. Like @dennorske said this is a Youtube thing and the ball is on youtube-dl or yt-dlp side Although I dont think they can provide a fix either.

It's a restriction that hits all services/tools that use yt-dlp or youtube-dl, whatever they do to retrieve video information

MC-shark commented 2 weeks ago

I try to use the torsocks yt-dlp https://www.youtube.com/watch?v=rIyRrUAsaok But it's not work

MichaelBelgium commented 2 weeks ago

According to the FAQ of yt-dlp

Your IP has been blocked by YouTube while you are logged out. You can pass logged-in cookies; however, doing so may get your account blocked. The safer solution is to use a different IP.

To prevent this, try passing a PO Token, though it will not help if your IP is already blocked.

Proxy is the safest solution

MC-shark commented 2 weeks ago

The api show SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'youtube_id' cannot be null (Connection: mysql, SQL: insert into youtube_logs (youtube_id, title, duration, format, user_id, created_at) values (?, ?, ?, mp3, 2103, 2024-11-14 09:14:28))

MC-shark commented 2 weeks ago
image
dennorske commented 2 weeks ago

It seems that the video failed to load, and because of that, the log could not store data relevant to the event. This seems to be a result of the problem, and the app is not handling it gracefully.

MichaelBelgium commented 2 weeks ago

The SQL error is fixed now.

Together with code changes to this repo and the Laravel version

MC-shark commented 2 days ago

Is there a good rotating proxy recommended

MichaelBelgium commented 2 days ago

For youtube.michaelbelgium.me i'm using cobalt now, which is a proxy itself and it's super quick!

Before I used rotating proxies of webshare

MC-shark commented 2 days ago

I using cobalt and add google oauth token to cookie, Response me

{ "status": "error", "error": { "code": "error.api.youtube.api_error" } }