-
Notifications
You must be signed in to change notification settings - Fork 17
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
problem jellyfin docker #5
Comments
I do not run Jellyfin, so I cannot say for sure. But it looks like the way the date_last_played time formatting returned for jellyfin may be different from how it is returned for emby.
This is the line with the formatting: |
how can i do that? |
You will have to do a few steps: Edit x2
Now run media_cleaner. After it has run, if you look in the /path/to/your/media_cleaner, a file called media_cleaner.debug will be there. Open that file. In it you should see lines that start with For emby it looks like this: |
debug log file is not present also if debug set to 1 |
Start...
|
We for sure know it is the time formatting that is causing the issue with jellyfin. How about your media_cleaner.debug file? What is inside of your debug file? Specifically I am looking for lines that look like this: I suggest you use https://pastebin.com to post the long files/logs like you have been doing above. It helps keep these posts cleaner and easier for people to read later. Here is an example of the media_cleaner.py script in pastebin. |
there is no such file in the same folder also if i configured DEBUG=1 as
suugeste.
…---------------------------------------------------------------
Il giorno sab 9 mag 2020 alle ore 01:28 terrelsa13 <notifications@github.com>
ha scritto:
We for sure know it is the time formatting that is causing the issue with
jellyfin.
How about your media_cleaner.debug file? What is inside of your debug
file? Specifically I am looking for lines that look like this: "LastPlayedDate":
"2020-03-24T06:52:14.1311383+00:00"
I suggest you use https://pastebin.com to post the long files/logs like
you have been doing above. It helps keep these posts cleaner and easier for
people to read later.
Here is an example of the media_cleaner.py <https://pastebin.com/sZJFwNLY>
script in pastebin.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQC7JCH2J4UVJBFQ7QLRQSIR3ANCNFSM4MDMW4JQ>
.
|
This is my fault. I must have made the changes need to create a debug file after the last merge. Here are the lines you will need to add to make the Go ahead and run the script again with Again, my mistake. |
can you posto the code so i can copy and paste instead to re-write?
thanks.
Il giorno lun 11 mag 2020 alle ore 21:34 terrelsa13 <
notifications@github.com> ha scritto:
… This is my fault. I must have made the changes need to create a debug file
after the last merge.
Here are the lines you will need to add to make the get_items() function
create the debug file.
*Original:*
<https://imgur.com/YTXbJ9p>
*New:*
<https://imgur.com/8I1EqF6>
Go ahead an run the script again with remove_files=0 and DEBUG=1.
A file called *media_cleaner.debug* will now be in the same folder as
*media_cleaner.py*.
Again, my mistake.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQHCL6ERYNPCEOOILFLRRBHNLANCNFSM4MDMW4JQ>
.
|
-----------------------------------------------------------
Start...
Cleaning media for server at: http://192.168.1.xxxx:8096
-----------------------------------------------------------
…-----------------------------------------------------------
Get List Of Watched Media
-----------------------------------------------------------
http://192.168.1.xxx:8096/emby/Users/xxxxxxxxxxxxxxxxxxxx/Items?Recursive=true&IsPlayed=true&api_key=xxxxxxxxxxxxxxxxxxx
Traceback (most recent call last):
File "media_cleaner_new.py", line 444, in <module>
deleteItems=get_items(cfg.server_url, cfg.user_key, cfg.access_token)
File "media_cleaner_new.py", line 200, in get_items
os.chdir(script_dir)
FileNotFoundError: [Errno 2] No such file or directory: ''
Il giorno mar 12 mag 2020 alle ore 16:58 terrelsa13 <
notifications@github.com> ha scritto:
Link <https://pastebin.com/rGxkihTT> to complete script.
Link <https://pastebin.com/e6bsmSe0> to only additional lines.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQGYMCXIUQUQ6G6EGLTRRFP2NANCNFSM4MDMW4JQ>
.
|
The user the script is run under will will need to have read-write-execute access to the folder the script is in. Please do a: |
root@openmediavault:~# pwd
/root
root@openmediavault:~# whoami
root
root@openmediavault:~# cd mediacleaner/
root@openmediavault:~/mediacleaner# whoami
root
root@openmediavault:~/mediacleaner# ls -lai
total 60
788907 drwxrwxrwx 3 root root 4096 May 12 17:04 .
654081 drwx------ 7 root root 4096 May 12 11:49 ..
654221 -rwxrwxrwx 1 root root 384 May 5 10:43 media_cleaner_config.py
804578 -rwxrwxrwx 1 root root 0 May 12 17:01 media_cleaner.debug
804579 -rwxrwxrwx 1 root root 20597 May 12 17:02 media_cleaner_new.py
654213 -rwxrwxrwx 1 root root 20195 May 12 17:01 media_cleaner.py
788908 drwxrwxrwx 2 root root 4096 May 5 10:44 __pycache__
root@openmediavault:~/mediacleaner# whoami
root
Il giorno mar 12 mag 2020 alle ore 17:42 terrelsa13 <
notifications@github.com> ha scritto:
… The user the script is run under will will need to have read-write-execute
access to the folder the script is in.
Please do a:
whoami
cd /path/to/your/media_cleaner/
whoami
ls -al
And post their outputs.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQB26N2FBXS22BK6HOLRRFU43ANCNFSM4MDMW4JQ>
.
|
We will skip trying to write the data into a debug file and just have it print directly to the screen. Try this: Link Depending on the size of your library, this could be a lot of data being printed to the screen. Hopefully you are able to scroll the terminal viewer you are using. |
@spupuz Any luck with getting the debug data to print directly to the screen? |
Yes but I got busy ... There are too sensitive data on the logs 😁
Il Mar 19 Mag 2020, 18:14 terrelsa13 <notifications@github.com> ha scritto:
… @spupuz <https://github.com/spupuz> Any luck with getting the debug data
to print directly to the screen?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQD3G3UPYCACQRACT2TRSKV77ANCNFSM4MDMW4JQ>
.
|
I tried adding the JellyFin time format into this script. I hope it will parse both Emby and JellyFin formats. When you get a chance run it with |
got this error:
Traceback (most recent call last):
File "media_cleaner_new3.py", line 528, in <module>
deleteItems=get_items(cfg.server_url, cfg.user_key, cfg.access_token)
File "media_cleaner_new3.py", line 264, in get_items
os.chdir(script_dir)
FileNotFoundError: [Errno 2] No such file or directory: ''
Il giorno mer 20 mag 2020 alle ore 03:51 terrelsa13 <
notifications@github.com> ha scritto:
… I tried adding the JellyFin time format into this script
<https://pastebin.com/ptfQPgw4>. I hope it will parse both Emby and
JellyFin formats.
When you get a chance run it with DEBUG=0 and remove_files=0. I do not
run JellyFin. But let me know what happens.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQBYU3XDZZ25LM6DGVDRSMZTDANCNFSM4MDMW4JQ>
.
|
no using from the same machine but from a different client respect the
jellyfin server
Il giorno mer 20 mag 2020 alle ore 07:31 Alessandro Belloni <
spupuz@gmail.com> ha scritto:
… got this error:
Traceback (most recent call last):
File "media_cleaner_new3.py", line 528, in <module>
deleteItems=get_items(cfg.server_url, cfg.user_key, cfg.access_token)
File "media_cleaner_new3.py", line 264, in get_items
os.chdir(script_dir)
FileNotFoundError: [Errno 2] No such file or directory: ''
Belloni Alessandro
http://www.linkedin.com/in/bellonialessandro
---------------------------------------------------------------
Il giorno mer 20 mag 2020 alle ore 03:51 terrelsa13 <
***@***.***> ha scritto:
> I tried adding the JellyFin time format into this script
> <https://pastebin.com/ptfQPgw4>. I hope it will parse both Emby and
> JellyFin formats.
>
> When you get a chance run it with DEBUG=0 and remove_files=0. I do not
> run JellyFin. But let me know what happens.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#5 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AANELQBYU3XDZZ25LM6DGVDRSMZTDANCNFSM4MDMW4JQ>
> .
>
|
Not being able to get the directory the script is running from is a separate issue we can address later. |
@terrelsa13 I would like to figure this out with you, I am not a dev but I can do proper testing. I tried your script from a few posts back #5 (comment)
|
@zilexa Hey.
|
@zilexa I see why this was failing. I was trying to use the debug variable from the config file before the config file is created. @spupuz I think I have come up with a resolution for the Jellyfin LastPlayedDate time formatting issue. Please try the media_cleaner.py script from my patch and let me know if that resolves your issue. |
I haven't look at it yet.
Il Dom 6 Set 2020, 01:55 terrelsa13 <notifications@github.com> ha scritto:
… @zilexa <https://github.com/zilexa> I see why this was failing. I was
trying to use the debug variable from the config file before the config
file is created.
@spupuz <https://github.com/spupuz> I think I have come up with a
resolution for the Jellyfin LastPlayedDate time formatting issue.
Please try the media_cleaner.py script from my patch
<https://github.com/terrelsa13/media_cleaner/tree/patch-1> and let me
know if that resolves your issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQERCCHGHKOJN5GQXN3SELFXRANCNFSM4MDMW4JQ>
.
|
I'll check
Il Dom 6 Set 2020, 17:53 terrelsa13 <notifications@github.com> ha scritto:
… @spupuz <https://github.com/spupuz> looks like @clara-j
<https://github.com/clara-j> merged my changes. You should be able to
update from the master.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQDAAAA7ZQ3K5U4RZ7TSEOV6HANCNFSM4MDMW4JQ>
.
|
I tried running the script, downloaded it today. Ran it (Jellyfin). How can I solve this? When I look at the script, this is the part that should work but does not:
It seems to expect Seperately, there is a "bad" episode, some blooper special, it can't handle that ep:
|
As for that "bad" episode. The script stops if it does not get data it expects to get from emby(jellyfin) to build the detailed output about what media is watched and what media will and will not be deleted. I have made an update in branch to verify it works for the other issue being reported. Dang. Thought I had that fixed. I will have to keep looking into the LastPlayedDate issue. I was hoping to avoid installing jellyfin. But I may have to in order to come up with a way for it to work for both emby and jellyfin. |
My jellyfin is not exposed to the internet but perhaps I could give you access via VPN.. not sure if that would open a box of new issues though. |
I changed your script: But still the same issue. Then I restored the change and only changed the word
to
But then the script actually fails, complaining about line 216 (which I did not modify). Now I am a bit clueless.. |
I have been poking around the code whenever I get the time. I have found a couple things.
I will let you know when I get an updated script you can try out. |
Are you using Jellyfin via Docker? I guess all I need is a method to delete any non-favourite content (movie or tv show) after status is watched. Would be nice if it runs daily and only deletes stuff if it has been watched xx days ago (I would go for 30 days max). But that of course requires days since last watched.. Perhaps the Jellyfin Forum can help here as the devs are quite active there. |
I can see how what I said was confusing. |
Oh wow! In that case it means your script should already be fully functional once you leave days since last watched out 👍 |
Ok. I have something here. This works with both my emby and my jellyfin. Fingers crossed it works for your jellyfin. |
FYI - Changes were added that either require you to create a new config file or will require manual input each time the script is run if a new config file is not created. |
OK I tried this version: https://github.com/terrelsa13/media_cleaner/tree/patch-1 When I look at what happened 17 days ago: that is when I installed Jellyfin (full clean install from scratch, starting with my OS, after a server ram issue). So it seems to 'know' which eps are watched, but it does not know yet when they are watched. |
Will you set DEBUG=1 in the config file, run the script again, and open the "media_cleaner.debug" file. |
I am still checking, but its always Could this be a Jellyfin bug? |
OH I think I understand the issue! After installing Jellyfin, I used the Trakt plugin to sync my watched status history (from Trakt) to Jellyfin. Trakt plugin must have had its initial run on the 3rd of september. And perhaps I watched a few things on the 10th. I guess I can lower the treshold to 15 days to get everything from the 3rd of sept deleted, then raise to 21-30 days or something. Going forward, your script should work for me! |
Yep, that is what I suspected. And it sounds like you also understand it now. Emby/Jellyfin would have no way of knowing when the watched date was unless it happened after your clean install or you also backed up the emyb/jellyfin database (which I think is where that kind of info is stored) and restored it after the clean install. Remember to set "remove_files=1" when you are ready to have the script actually delete these media files. |
@spupuz if we have resolved the original problem, please close this issue when you get a chance. Changes are in my repository until they are merged here. |
Need to test the script.
Il Mar 22 Set 2020, 01:14 terrelsa13 <notifications@github.com> ha scritto:
… @spupuz <https://github.com/spupuz> if we have resolved the original
problem, please close this issue when you get a chance.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANELQD5KIJ4WVQCJP6RI5LSG7M7HANCNFSM4MDMW4JQ>
.
|
it works successfully. Feel free to close this one. |
Update to state hashed password stored
@spupuz This has been resolved for quite some time. Please close this issue. |
not working for me Jellyfin is inside a docker image:
root@openmediavault:~# ./media_cleaner.py
Start...
Cleaning media for server at: http://192.168.1.xxx:8096
Get List Of Watched Media
Traceback (most recent call last):
File "./media_cleaner.py", line 436, in
deleteItems=get_items(cfg.server_url, cfg.user_key, cfg.access_token)
File "./media_cleaner.py", line 228, in get_items
item_details=item['Type'] + ' - ' + item['SeriesName'] + ' - ' + item['Name'] + ' - ' + get_days_since_watched(item['UserData']['LastPlayedDate']) + ' - Favorite: ' + str(item['UserData']['IsFavorite']) + ' - ' + 'EpisodeID: ' + item['Id']
File "./media_cleaner.py", line 167, in get_days_since_watched
date_time_last_watched = datetime.strptime(date_last_played, '%Y-%m-%dT%H:%M:%S.0000000+00:00')
File "/usr/lib/python3.7/_strptime.py", line 577, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "/usr/lib/python3.7/_strptime.py", line 359, in _strptime
(data_string, format))
ValueError: time data '2020-03-24T06:52:14.1311383Z' does not match format '%Y-%m-%dT%H:%M:%S.0000000+00:00'
root@openmediavault:~#
The text was updated successfully, but these errors were encountered: