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
228 stars 21 forks source link

Error #34

Closed BitBlockv6 closed 7 months ago

BitBlockv6 commented 8 months ago

I get the following Error message from ytdl2STRM installed in an virtual env in /opt: 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 374, in ).get_channels() ^^^^^^^^^^^^^^ File "/opt/ytdlp2STRM/clases/config/config.py", line 41, in get_channels config_data = json.load(file) ^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/init.py", line 293, in load return loads(fp.read(), ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 3 column 1 (char 43)

fanyangto commented 8 months ago

Are you sure you have customized the systemd service file to reflect that you are using venv python3 ? Here is what I did and it works. Notice I didn't put the ytdlp2strm dir under /opt. The most important line is execstart.


[Unit]
Description=ytdlp2STRM Service
After=network-online.target

[Service]
WorkingDirectory=/home/ubuntu/ytdlp2STRM
Type=simple
ExecStart=/home/ubuntu/venv2/bin/python3 /home/ubuntu/ytdlp2STRM/main.py
Restart=always
RestartSec=10

[Install]
WantedBy=default.target
BitBlockv6 commented 8 months ago

Are you sure you have customized the systemd service file to reflect that you are using venv python3 ? Here is what I did and it works. Notice I didn't put the ytdlp2strm dir under /opt. The most important line is execstart.


[Unit]
Description=ytdlp2STRM Service
After=network-online.target

[Service]
WorkingDirectory=/home/ubuntu/ytdlp2STRM
Type=simple
ExecStart=/home/ubuntu/venv2/bin/python3 /home/ubuntu/ytdlp2STRM/main.py
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

Here is mine systemd file: [Unit] Description=ytdlp2STRM Service After=network-online.target [Service] WorkingDirectory=/opt/ytdlp2STRM Type=simple ExecStart=/opt/ytdlp2STRM/bin/python3 /opt/ytdlp2STRM/main.py Restart=always RestartSec=10 [Install] WantedBy=default.target

The web-ui works on port 5000 but didnt create any strm files. I tried with the example lists and own ones. And tried for example manually with /opt/ytdlp2STRM/bin/python3 /opt/ytdlp2STRM/main.py --media youtube --params direct but always get an error, of course i installed reauierements.txt in the venv. I'am not a dev just an user and out of ideas right now. For me the error messages looks like the list with the youtube (even twitch) links can't be parsed or something.

BitBlockv6 commented 8 months ago

I could solve the problem with swapping the yt-dlp binary in bin folder with an actual binary from the git-hub page. But now i am struggeling with the .strm files. When I insert a playlist url ( list-"youtubeid" ) i get in jellyfin one listing without picture, metadata and is not playable. I tried even with keyword-"somesearch" but get nothing playable not in direct or bridge mode.

Someone can help me ?

fanyangto commented 8 months ago

hi, mine is working in terms of generating the nfo and strm files. It just doesn't generate them according to the schedule I set. But overnight, it does generate all the youtube channel content. Not sure why changing the schedule to every hour than every day didn't work.

I highly recommend you use docker. This way, it removes most of the uncertainty as the docker image is a fully tested bundle of packages. It's not that hard to install docker and than run docker image. You can use the following article to install docker.

Here is the command to start the docker image: sudo docker run -d -v ~ubuntu/media:/media -p 5000:5000 fe80grau/ytdlp2strm

Now you can focus on the real problem than struggling with the packages.

fanyangto commented 8 months ago

I could solve the problem with swapping the yt-dlp binary in bin folder with an actual binary from the git-hub page. But now i am struggeling with the .strm files. When I insert a playlist url ( list-"youtubeid" ) i get in jellyfin one listing without picture, metadata and is not playable. I tried even with keyword-"somesearch" but get nothing playable not in direct or bridge mode.

Someone can help me ?

I agree with you. I have copied the youtube strm files into jellyfin library. Jellyfin seems to be able to scan the library. But nothing is playable . It complains about the stream is not playable, or not in recognizable format.

fe80Grau commented 8 months ago

what's your output if you run this command under your venv? /home/ubuntu/venv2/bin/python3 /home/ubuntu/ytdlp2STRM/cli.py --media youtube --params direct