-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue with Jellyfin and strm files on Raspberry Pi3b+ #5
Comments
if i run pip install sanitize_filename it says already installed. Maybe there is an error in cli.py? |
Running make_files_strm with ['youtube', 'stream'] params After installing via sudo pip install sanitize_filename there was another error, any ideas on this? |
Hi @CrazyWolf13 . It seems the code breaks when reading channel_list.json , "expecting ',' delimiter" says this error |
Well, that was quite embarrassing, I missed out on a "," But after fixing the "," issue is still got an error: Running make_files_strm with ['youtube', 'stream'] params |
Mmmmm with /user/xbox channel:
tell me your OS and yt-dlp version maybe helps to clear this problem. |
I'm running Raspian a Raspberry Pi3b+ https://www.youtube.com/channel/UCjBp_7RuDBUYbd1LegWEJ8g yt-dlp is on version: stable@2023.03.04 pip install -U yt-dlp "Defaulting to user installation because normal site-packages is not writeable |
Pull last commit in main, and paste here output. I need to see the string of yt-dlp command builded and them output. I think that is returns False allways when subprocess.getouput(command) is executed, in that case it's probably a permissions problem, the user that runs python script needs permission to run yt-dlp command. Is this so now? |
Sorry for the delay, had to get some rest. I don't think I have changed a lot in permissions so they "should" be default raspian permissions. Now it seems stuck. Hasn't changed since minutes. |
Seems to have finished now: Inflating nfo.. Traceback (most recent call last): There are three folders:
|
You have channel id now, this is so good. STRM files can be played with Jellyfin , VLC or other video streaming service. For example the last video in leagueoflegends channel is from 3 weeks ago, by default i set 60 days old and 100 limit videos to check. Evaluate if you change this. By the way, i added some prints to debug in last commit **Delete Youtube-STRM/ [UC2t5bjwHdUX4vM2g8TRDq5g] and Youtube-STRM/ [Falso] are bugs.. I checked my folder and i found fails folder, maybe yt-dlp fails sometimes or after a lot of use. I will check this with more patience |
Thank you for the reply. |
In line 264, when lines is blank (te command output fails o something), the script is entering in for and breaks, i added one line to check if line is not blank. Pull last commit and run it again. |
cd /opt/ytdlp2STRM && /usr/bin/python3 /opt/ytdlp2STRM/cli.py --m make_files_strm --p youtube,stream Processing videos in channel Processing videos in channel Processing videos in channel Processing videos in channel Seems to work |
Perfect!! I am very happy that it works 😄 Try it if you want and tell me if description is working. If you do that and the description is still blank, run the following command and paste the output here please. |
After downloading the new cli.py it seems to be broken, but maybe i have formated the channel list wrong? Error: Channel_list: [ Is there something wrong with it? |
Here is the mentioned yt-dlp output: yt-dlp https://www.youtube.com/channel/UC8679JjreNLfSCgA-2Fb4kA --write-description --playlist-items 0 --output "/mnt/Seagate/Youtube-STRM/SpineCard.description":
Apologize for the confusion, I used a different folder. The command works. yt-dlp https://www.youtube.com/channel/UC8679JjreNLfSCgA-2Fb4kA --write-description --playlist-items 0 --output "/mnt/Seagate/Youtube-STRM/SpineCard.description" SpineCard.description: |
Perrfect, description should work now in cli.py. thank you very much for outputs. And your channel list it's okay, i edited my list with yours (without indent too) and works. Is working if you declare more channels? |
I tested with the exact channels as in channel_list.example.json and i'm still getting the error. Files is saved with nano, just normal ctrl-x+y |
Thank you very much ❤️ ! It was a missing quote :/ Everything seems to work fine now. I will try out the sponsorblock in the next days, maybe even today. |
Files are being generated but jellyfin can't play them, there is just the error the client is not compatible with the media and the server does not send a compatible media format. jellyfin-log: And a bunch more. |
Check if service is running |
● ytdlp2strm.service - ytdlp2STRM Service Apr 15 17:04:17 raspberrypi python3[549]: for item in iterable:
|
install yt-dlp as root and restart service |
● ytdlp2strm.service - ytdlp2STRM Service Apr 15 17:26:41 raspberrypi systemd[1]: Started ytdlp2STRM Service. Seems a lot better to me. Should this service start automatically? or why did that happen? |
Jellyfin just loads forever :/ and never starts playing the video. at lambda_method1060(Closure , Object ) |
after play a video check service status. If is an flask or stream error should show with systemctl status ytdl2strm.service If you are in local try to play a video in VLC (file -> open network medio or something like this), get an strm file content (you will see an URL like http://127.0.0.1:5000/youtube/download/689h31Np29E, change 127.0.0.1 by ytdlp2strm local IP) **I detect a problem with stream mode and "short", for example http://127.0.0.1:5000/youtube/stream/pCflI9qLDX0 <- is not working i will work to fix this. You can use download mode (disk usage is temporaly) |
Status log after restarting and then starting to play the video on jellyfin, there is just a circle turning infinitely. sudo systemctl status ytdlp2strm.service Apr 15 17:55:51 raspberrypi systemd[1]: Started ytdlp2STRM Service. pi@raspberrypi:~ $ sudo systemctl status ytdlp2strm.service Apr 15 17:56:24 raspberrypi python3[4168]: Stream #0:2(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 44100 > layback?expire=1681595775&ei=H8k6ZJ3vB4W2-gagz42gAQ&ip=2a02%3A1210%3A2a42%3Aeb00%3Afd64%3Aff56%3A20b6%3A5d1f&id=o-> layback?expire=1681595775&ei=H8k6ZJ3vB4W2-gagz42gAQ&ip=2a02%3A1210%3A2a42%3Aeb00%3Afd64%3Aff56%3A20b6%3A5d1f&id=o-> layback?expire=1681595775&ei=H8k6ZJ3vB4W2-gagz42gAQ&ip=2a02%3A1210%3A2a42%3Aeb00%3Afd64%3Aff56%3A20b6%3A5d1f&id=o-> 2(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 44100 Hz, stereo, fltp, 10 kb/s (default) _time : 2023-04-06T08:43:19.000000Z Apr 15 17:56:24 raspberrypi python3[4168]: Stream #0:2(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 44100 > http://127.0.0.1:5000/youtube/stream/pCflI9qLDX0 Both of them work, the stream one starts faster. |
This is the jellyfin log: [2023-04-15 17:39:32.056 +02:00] [WRN] Slow HTTP Response from "http://192.168.1.111:8096/Items/dbd78304db264716eaaceabef354a274/PlaybackInfo?UserId=4d20fdb2ee484e7faf7ac453e424cd96&StartTimeTicks=0&IsPlayback=true&AutoOpenLiveStream=true&MaxStreamingBitrate=140000000" to "192.168.1.116" in 0:00:54.5889167 with Status Code 500 |
Sorry for just spamming my logs 😢 |
The last error says: [2023-04-15 17:56:11.685 +02:00] [INF] "/usr/lib/jellyfin-ffmpeg/ffprobe" "-analyzeduration 200M -i "http://127.0.0.1:5000/youtube/stream/377lsCtAAAU\" -threads 0 -v warning -print_format json -show_streams -show_chapters -show_format" [2023-04-15 17:56:24.587 +02:00] [ERR] Error in "YoutubeMetadata" System.IO.FileNotFoundException: Could not find file '/mnt/Seagate/Youtube-STRM/@xbox [UCjBp_7RuDBUYbd1LegWEJ8g]/4 Years and Counting! Uncover the Surprises of the Latest Update in World of Warships Legends [377lsCtAAAU].info.json'. YoutubeMetada try to make .info.json for each Youtube video (in our case each strm file) . Try disabling YoutubeMetada plugin, fully restart your server (i would say a complete reboot) and try again. |
YoutubeMetadata has now been turned off after some trouble. Now the blue circle turns and then there is just a black screen. :/ |
I think i'll ask in the jellyfin help matrix chats, don't really want to bother you with this issue^^. |
Okey mate, i keep open this issue. if you found a solution and remember this post please share it 😄 |
Hey, yeah they could actually help me, the strm live stream mode i chose was too much for the raspberrypi, I thought it would simply pass the link to the client not that the pi has to download it in real time and server it to the client at the same time (0.2x speed did it manage to get lol) So I think choosing the download command should fix this issue, one moment i will test it. |
I think for the moment i will use regular yt-dlp to download the files and import them to jellyfin, that seems the easiest with my raspberrypi. I'm really sorry, to tell this, but maybe in the future when i have more knowledge about android i could try to write some sort of android app around this to allow the user to choose a video from a simple youtube ui, then ytdlp2strm takes those and routes them either via strm or via video/audio file to jellyfin and syncs the library. |
Very good idea, I added a new mode besides stream and download. I called it "redirect" and it does exactly that you say, a 301 redirect to the temporary youtube URL of the video/audio mixed. Luckily yt-dlp manages this. With redirect mode the load is fast, no cpu is used and no disk is used. I added it in the README, but you can make the simple change in the cron job file and edit the download or stream parameter to redirect Sponsorblock not works in redirect mode |
Well, doesn't my pi still has to download the video and stream it to the client? |
stream mode gets video data from yt-dlp and pass throught http directly, don't wait complete video download, this process is managed by yt-dlp. download mode first download full video in temp file and then the file is served like a normal file throught http server with redirect mode your pi doesn't download video and doesn't stream video data, this mode only redirect and amazingly it is working 😄 |
Ohh really, I though I dreamed when I read this lol. Command is currently running and I'm waiting to see the results:) |
It actually works, I'm very surprised! Thank you soo much for doing this and helping me all day long, this really made my day. ❤️ If you ever need a helping hand here or help with testing feel free to mention me at any time. |
Yeahh!! I told you we'd get it and we got it. Anyway, thank you very much also for your patience with the trial / error . Any other comment, idea, suggestion, bug (I hope it's not that) or anything is welcome. Finally I can consider this issue resolved |
@CrazyWolf13 , if you want more power than your Raspberry, you can get "always free instance" in Oracle Register a user with your country, but when you are in the "country choice" for server, select France (Marselle), Spain (Madrid) or search in reddit a country with ARM instances available (in a lot of countrys are all bussy). You can deploy for always free an ARM instance with 4 vCPU, 24GB RAM and 200GB disk space, if you have pcloud, gdrive, onedrive you can use rclone to work with no space restrictions !!! I'm one of this and works very well with Jellyfin and 4K video and IPTV. |
Thank you very much for this suggestion, but at the moment I prefer to only have my files locally, but I will keep this in mind. |
I get this error when i execute the cron job, but I think I installed the sanitize filename via requirements.txt ?
Traceback (most recent call last):
File "/opt/ytdlp2STRM/cli.py", line 8, in
from sanitize_filename import sanitize
ModuleNotFoundError: No module named 'sanitize_filename'
@fe80Grau edit:
The text was updated successfully, but these errors were encountered: