fe80Grau / ytdlp2STRM

A little script to serve Youtube / Twitch / Crunchyroll videos without storage it. Uses yt-dlp HTTP data throught Flask and dynamic URLs. We can use this dynamic URLs to set STRM files.
https://github.com/fe80Grau/ytdlp2STRM
MIT License
200 stars 19 forks source link

Playback Errors #55

Closed snppls closed 3 days ago

snppls commented 2 months ago

Thanks for the great project.

My instance seems to import videos but it won't play anything. I get playback errors every time I try to play something. Any suggestions?

Screenshot 2024-07-04 171732

fe80Grau commented 1 month ago

Can you copy here an example of your channel_list.json?

IIIPr0t0typ3III commented 1 month ago

Hey there. I have maybe a similar problem (regarding only YouTube; Twitch works fine):

Everything from the channel_list downloads fine and I get the .strm files as well as the .nfo files but when I try to open the.strm in Jellyfin it loads a little and then tells me

Playback Error

Playback failed due to a fatal player error.

I also tried accessing the link directly in firefox which redirects me to the underlying googlevideo link and results in a HTTP response of 403 (Forbidden) while the page stays blank. I am not sure if that helps but I thought providing that information doesn't hurt.

If I can help to further debug and fix this just let me know!

On another note: Thanks for providing and maintaining this cool project!

IIIPr0t0typ3III commented 1 month ago

I just found the problem: It is an out of date version of yt-dlp I went into the container via docker exec -it ytdlp2strm bash and updated yt-dlp to the latest version via pip install --upgrade yt-dlp --user. And everything works after that.

Temporary Fix

A possible fix for machines able to run cron is to just add a cronjob on your host machine that runs the update command once a day (maximum of 24h where the streaming does not work) like:

0   0   *   *   *   docker exec ytdlp2strm pip install --upgrade yt-dlp --user

For machines (like Windows) that do not have cron another possibility is to go into the docker container, install cron and put the update cronjob into the crontab there like:

user@yourmachine$ docker exec -it ytdlp2strm bash
root@<CONTAINER_ID>:/opt/ytdlp2STRM# apt install cron
root@<CONTAINER_ID>:/opt/ytdlp2STRM# echo "0   0   *   *   *   docker exec ytdlp2strm pip install --upgrade yt-dlp --user" >> /var/spool/cron/crontabs/root
root@<CONTAINER_ID>:/opt/ytdlp2STRM# exit

Complete Fix

It would be good to include the cronjob into the code (using the cron.py class) but since this might add some work the fix above should be completely sufficient.

@fe80Grau If you want I can have a look into the code and create a pull request with the fix some time in the next weeks.

Druidblack commented 1 month ago

Upgrading to the latest version did not help. And also, when I try to reproduce the stream, I get a fatal error.

Druidblack commented 1 month ago

I tried to open those links that are created in a file that can be accessed by opening a link from the program. Google informs me that there is suspicious activity from my address and does not allow me to open the video stream. Could this be giving an error in jf?

Druidblack commented 1 month ago

I tried broadcasting from twitch, I get the same error about a fatal playback error.

fe80Grau commented 1 month ago

Hi, sorry for the delay in getting back to you. I'm very busy with work. Let's try to solve your issue.

First of all, I see that in the first screenshot you sent, there's an error in detecting the name of the channel.. [ERROR unsupported URL...]

First, run the following command in your terminal and let's see its output:

yt-dlp https://www.youtube.com/@TheoVon --compat-options no-youtube-unavailable-videos --compat-options no-youtube-channel-redirect --print "%(channel)s" --restrict-filenames --playlist-items 1 

Then, try to get a direct URL and see what happens:

yt-dlp -f best https://www.youtube.com/watch?v=tLFvJ7OvVP4 --get-url

This should return a URL. Try to play this URL with VLC or directly in a browser.

With this, I want to check whether the issue you're experiencing is with yt-dlp or due to some blockage from YouTube.

Druidblack commented 1 month ago

The error with determining the channel name is due to the fact that in the settings file (example) you suggest specifying the full link to the channel (stream). Because of this, the program adds an extra / when scanning . There is a mistake because of this .if you do it in the program as shown in the screenshot, then there is no such error.

But it also raises the question why does the program add /video at the end of the channel request line?

Безымянный

Druidblack commented 1 month ago

That's all I did after the update yt-dlp (pip install --upgrade yt-dlp --user)

Druidblack commented 1 month ago

Does the program not delete old files after creating new ones? She created a lot of files for me.

3543453

234224

Druidblack commented 1 month ago

I have now started the broadcast that the program generated. And why is there no sound through vlc? укуку

Druidblack commented 1 month ago

jf still throws a fatal playback error 8FVzwdbQnaE.txt This is the file that the program generates for me when requesting a link from a stream file. Without txt

Druidblack commented 4 weeks ago

When watching broadcasts, is there a need to enable hardware acceleration in Jf?

fe80Grau commented 4 weeks ago

Point by point:

Honestly, with all the problems you are experiencing I think it must be related to the blocking by YouTube. How many channels have you declared in channel_list.json? And what is your value for videos_limit in ./plugins/youtube/config.json?

Druidblack commented 4 weeks ago

I admit, I may have had problems with the sound. I tried to make links to two streams. Today I will try to add more channels and streams. Youtube blocking works for me at the router level. I'm not the only one with this problem. Blocking youtube does not prevent me from opening the link in the vlc player. So jf should open it too. And that's why he can't ask her, that's the question.

Druidblack commented 4 weeks ago

Безымянный Apparently you haven't updated the docker image yet.

fe80Grau commented 5 days ago

Check last coomit please, I have rewritten the entire Youtube plugin