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
209 stars 19 forks source link

Try but fall #21

Closed VLiulian closed 8 months ago

VLiulian commented 10 months ago

Hi! Your project looks interesting. I followed your instructions to create a docker, but unfortunately I didn't end up with anything that works: I don't have any files in my /media folder, even if I changed the cron data or added a new youtube channel.

P.S I have a gui in localhost:5005

fe80Grau commented 10 months ago

Go to yout ytdlp2STRM folder and run:

python cli.py --media youtube --params direct

and paste the output here.

VLiulian commented 10 months ago

Hi, this the output : /opt/ytdlp2STRM$ sudo python cli.py --media youtube --params direct

Traceback (most recent call last): File "/opt/ytdlp2STRM/cli.py", line 3, in import config.plugins as plugins File "/opt/ytdlp2STRM/config/plugins.py", line 2, in from plugins.youtube import youtube File "/opt/ytdlp2STRM/plugins/youtube/youtube.py", line 1, in from flask import stream_with_context, Response, send_file, redirect ModuleNotFoundError: No module named 'flask'

Bortronx commented 10 months ago

@VLiulian Did you try installing the requirements again? Make sure you use sudo or maybe install requirements manually.

Bortronx commented 10 months ago

Go to yout ytdlp2STRM folder and run:

python cli.py --media youtube --params direct

and paste the output here.

I have a similar issue and this is what I get when I try that command.

Running youtube with ['direct'] params
Preparing channel https://www.youtube.com/user/xbox
/user/xbox
Working channel URL: https://www.youtube.com/user/xbox
Getting channel ID...
Traceback (most recent call last):
  File "C:\ProgramData\ytdlp2STRM\cli.py", line 64, in <module>
    main()
  File "C:\ProgramData\ytdlp2STRM\cli.py", line 61, in main
    r = eval("{}.{}.{}".format("plugins",method,"to_strm"))(*params)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\ytdlp2STRM\plugins\youtube\youtube.py", line 618, in to_strm
    channel_strm(
  File "C:\ProgramData\ytdlp2STRM\plugins\youtube\youtube.py", line 395, in channel_strm
    yt = Youtube(
         ^^^^^^^^
  File "C:\ProgramData\ytdlp2STRM\plugins\youtube\youtube.py", line 25, in __init__
    self.channel_id = self.get_id()
                      ^^^^^^^^^^^^^
  File "C:\ProgramData\ytdlp2STRM\plugins\youtube\youtube.py", line 81, in get_id
    self.get_id(
TypeError: Youtube.get_id() takes 1 positional argument but 2 were given

Also I don't understand the Jellyfin instructions. Can you elaborate? I try to put media/Youtube on the Jellyfin Library dashboard and it just gives me an error:

"There was an an error adding the media path. Ensure the path is valid and Jellyfin has access to it"

fe80Grau commented 10 months ago

@Bortronx I've made a small fix in the YouTube class,. It's not typical, but please try it with the latest commit may be works. Additionally, it would be helpful if you could execute the following yt-dlp command in your terminal and paste the output here:

yt-dlp --compat-options no-youtube-channel-redirect --compat-options no-youtube-unavailable-videos --restrict-filenames --ignore-errors --no-warnings --playlist-start 1 --playlist-end 1 --print channel_url https://www.youtube.com/user/xbox

Regarding the Jellyfin media library setup, you only need to add the strm_output_folder that you have configured in the plugin. For example, on my Windows machine, I have set the strm_output_folder in the YouTube plugin to D:/Youtube. This means that all Youtube STRM files will be created inside this directory. Therefore, D:/Youtube is the folder I need to add to Jellyfin as a media library.