Closed Noursanb closed 2 years ago
Hey @Noursanb
The script is expecting the libraryIds to be 32 characters long. It appears you libraryIds are 1, 2, and 3 characters long.
Below you will see your libids are 33, 482, and 4.
user_wl_libs=[
{
"userid": "edad7076a00743d78ccca5c6a3e21e6e",
"username": "emby",
"0": {
"libid": "33",
"collectiontype": "tvshows",
"path": "/home/Media/Datas/Anime",
"networkpath": ""
},
"1": {
"libid": "482",
"collectiontype": "movies",
"path": "/home/Media/Datas/Movies",
"networkpath": ""
},
"2": {
"libid": "4",
"collectiontype": "tvshows",
"path": "/home/Media/Datas/TvShows ",
"networkpath": ""
}
}
We can verify these libIds are correct. Put the link below into the browser of your Emby server; then press ENTER.
http://localhost:8096/emby/Library/VirtualFolders/Query?api_key=5739d5bdc8ca41d8bbb4e67187ffab4c
That is a first. Never seen libraries with Ids shorter than 32-characters. I will have to figure out a better way to verify the values in the config later. But for now...
Try the attached script. The check for 32-character libId length is change to check at least 1-character.
mumc.py.txt
into the same folder as mumc.py
mumc.py
to mumc.py.orig
mumc.py.txt
to mumc.py
👀 I have more errors but still not working .!!? mumc_DEBUG.log
The mumc_DEBUG.log
shows the script finished without any errors.
Will you copy/paste or screenshot the error(s) you are seeing?
I don't have any error that is displayed it's just he doesn't see the tvshows seen to delete them
!
That last mumc_debug.log
shows the script is not configured to find media items to delete.
Please read Step#1 thru Step#6. This will explain how the values in the configuration file can be used to delete media.
Also please read Blacklisting vs Whitelisting. As that last mumc_debug.log
shows all of your libraries have been whitelisted.
In the config file and I changed only this setting and the rest is default still the same problem he does not see but media !!!!!
movie_played_days=0 movie_created_days=0
episode_played_days=0 episode_created_days=0
REMOVE_FILES=True
thank you for your help
If you have run the script like you are showing above, it is possible it has already deleted ALL of your movies and episodes.
Step#4 explains why setting *_created_days=0
or setting them to any low number is something you NEVER want to do.
REMOVE_FILES=False
DEBUG=4
mumc_DEBUG.log
to your reply.no, the media have not been deleted!! mumc_DEBUG.log
Ok. I am looking at what the mumc_DEBUG.log
file says and it does not match what you are telling me.
mumc_config.py
file you have changed is also in the same folder as the mumc.py
script you are running.REMOVE_FILES
is still set to True. Please change this to False.DEBUG
is equal to 3. Please change this to 4.mumc_config.py
is not setup to delete anything. I can tell because of the values in the mumc_DEBUG.log
sent in the last message. All of the *_played_days
and *_created_days
are equal to -1.movie_played_days=-1
episode_played_days=-1
audio_played_days=-1
movie_created_days=-1
episode_created_days=-1
audio_created_days=-1
I also send you the configuration file... mumc_DEBUG.log mumc_config.py.txt
During setup you choose whitelisting and then selected all libraries. Please read the link I provided earlier about blacklisting vs whitelisting.
Also please read Blacklisting vs Whitelisting. As that last mumc_debug.log
shows all of your libraries have been whitelisted.
delete_media_item_request - url request: generic exception: Traceback (most recent call last): File "./mumc.py", line 6984, in delete_media_item requestURL(req, GLOBAL_DEBUG, 'delete_media_item_request', 3) File "./mumc.py", line 80, in requestURL appendTo_DEBUG_log("\n" + url,3) TypeError: can only concatenate str (not "Request") to str [DELETED] Episode - Grey's Anatomy - s19.e01 - Everything Has Changed - 255
I think I know what's wrong here. I will be able to take a closer look later.
Try this. It should fix the TypeError occurring when the script is writing to the debug file.
thanks for your availability
Did we get you working correctly?
I see in email you were getting this error:
RuntimeError:
AUTH_ERROR: User Not Authorized To Access Library
Likely means the user chosen as the admin user (emby) does not have permission to delete from the libraries. You can fix this by either setting up the script again using the admin account for the server and then blacklist/whitelisting libraries for non-admin users. Or, if Emby is your admin user, by logging into Emby as the admin user and selecting:
The other issue could be the admin username emby does not have the necessary Linux permissions to delete files from the OS. This usually isn't the case as emby:emby should be the default username:groupname and should have permissions. But take a look at Setting Proper Linux Permissions For Emby/Jellyfin it might help.
it works thank you very much for the work and that you do it is availability and the patience that you show thank you and I wish you a great day
Awesome! Glad it works.
Thank you very much. You have a great day too!
Hello, Thank you for your work, it's really great. The script is not working properly for me, I got this #error
ValueError: In user_wl_libs for user edad7076a00743d78ccca5c6a3e21e6e the libid for library with key0 is not a 32 character alphanumeric string ValueError: In user_wl_libs for user edad7076a00743d78ccca5c6a3e21e6e the libid for library with key1 is not a 32 character alphanumeric string ValueError: In user_wl_libs for user edad7076a00743d78ccca5c6a3e21e6e the libid for library with key2 is not a 32 character alphanumeric string
thank you for your help
mumc_DEBUG.log