drazzilb08 / daps Goto Github PK
View Code? Open in Web Editor NEWDAPS (Drazzilb's Arr PMM Scripts) A collection of useful scripts for media management and automation
License: MIT License
DAPS (Drazzilb's Arr PMM Scripts) A collection of useful scripts for media management and automation
License: MIT License
Steps to reproduce:
I think the issue is an underscore and a dash got swapped?
search and replace cut -c 2- | rev | cut -c 2- | rev
with sed -e 's/^"//' -e 's/"$//'
and the script no longer depends on rev
which is not available on eg synology
https://github.com/Drazzilb08/daps/wiki has a search&replace-like typo 🙂
*********************** POSTER RENAMERR Version: 1.0.5 ***********************
03/29/24 03:28 PM INFO: Running POSTER RENAMERR
03/29/24 03:28 PM INFO:
*************************** START POSTER
03/29/24 03:28 PM INFO: Running sync_gdrive
03/29/24 03:31 PM INFO: Finished running sync_gdrive
03/29/24 03:41 PM ERROR:
An error occurred:
Traceback (most recent call last):
��File "/app/modules/poster_renamerr.py", line 652, in main
����output = rename_files(matched_assets, script_config, logger)
�������������^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
��File "/app/modules/poster_renamerr.py", line 285, in rename_files
����season_number = (re.search(r"Season (\d+)", file_name).group(1) if "Season" in file_name else "00").zfill(2)
���������������������^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'
03/29/24 03:41 PM ERROR:
03/29/24 03:41 PM INFO:
**************************** END POSTER RENAMERR *****************************
Please add error handling :)
Hi,
I noticed that some of the jokes result in invalid JSON as they contain double quotes.
Example
{
"text": "Powered by: Drazzilb | A photon checks into a hotel. Receptionist: "May I take your bags sir?" Photon: "I don't have any bags, I'm travelling light.""
}
The double quotes should either be made single quotes or escaped
{
"text": "Powered by: Drazzilb | A photon checks into a hotel. Receptionist: \"May I take your bags sir?\" Photon: \"I don't have any bags, I'm travelling light.\""
}
I've modified the joke line to be
joke=$(curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed 's/"/\\"/g')
I'm sure there are folks like me who have users request media from Overseerr and end up forgetting to watch them after they get added. It would be nice to have a script that integrates with Overseerr and Tautulli to be able to generate a list of unwatched media based on what has been requested by the users. That way you can decide to either follow up with the user to see if they are still interested in watching or delete the media.
When testing to add a holiday schedule in border_replacerr under normal run conditions, I discovered that certain date ranges are being ignored by the script. Originally, I was testing under normal runs, but then switched to testing various dates by just running the script using docker at the command line with a small test source library and output folder. The issue persists regardless of how daps is executed.
End date ranges of 7/1 through 7/12 will not run the schedule. No errors are reported in dubug log, it just ignores those dates.
Example with screenshots below: range: (6/5-7/4) will not run, but range: (6/5-7/13) will run.
I would estimate probably trying 100 different dates/months. I tested this with and without several combinations of leading zeros in single digit dates.
Time stamp needs to be set when notification is sent. Not when script starts. Variable needs to be moved to discord notification section.
All discord scripts.
How to recreate the issue on unraid:
Install any docker app. For example, Prowlar, name it prowlar-test
(name itself is not important)
Once installed, stop prowlar-test
Go to app data and manually delete prowlar-test
folder
Don't do anything to the app.
Run the backup-appdata script
Check backup-data config file, for the purpose of the test, move prowlar-test
higher up on the stop-list, like in the config below.
The script will run until it reaches prowlarr-test
on the list and then it will stop making backups of any containers that are after the prowlarr-test
on the list
From the example config below, only radarr.tar
will be created, sonarr.tar
will not be as the script stops.
Config:
destination_dir='/mnt/user/BACKUPS'
keep_backup=10
compress=false
exclude_file='/mnt/user/appdata/scripts/backup-appdata/exclude-file.conf'
add_to_stop=true
add_to_no_stop=false
dry_run=false
quiet=false
#------------- DEFINE CONTAINERS TO BACKUP -------------#
stop_list=(
radarr
prowlar-test
sonarr
)
no_stop_list=(
unpackerr
)
exclusion_list=(
plex
)
appdata_dir1="/mnt/user/appdata"
appdata_dir2="/mnt/cache_nvme/appdata"
log:
Script Starting Mar 20, 2023 21:21.17
Full logs for this script are available at /tmp/user.scripts/tmpScripts/Unraid - Backup appdata/log.txt
Config file: /mnt/user/appdata/scripts/backup-appdata/backup-appdata.conf
-----------------------------------
Source Directory: /mnt/user/appdata/radarr
Checking space requirements... Please wait...
Checking space requirements complete...
Backing up radarr
Exclude file /mnt/user/appdata/scripts/backup-appdata/exclude-file.conf
backup file: /mnt/user/BACKUPS/[email protected]/radarr.tar
Backup of radarr complete
Container: radarr Backup size: 47M
-----------------------------------
Source Directory: /mnt/user/appdata/prowlarr-test
Container prowlarr-test is not running
Checking space requirements... Please wait...
du: cannot access '/mnt/user/appdata/prowlarr-test': No such file or directory
/mnt/user/appdata/scripts/backup-appdata/backup-appdata.sh: line 57: [: : integer expression expected
Checking space requirements complete...
/mnt/user/appdata/scripts/backup-appdata/backup-appdata.sh: line 168: cd: /mnt/user/appdata/prowlarr-test/..: No such file or directory
Script Finished Mar 20, 2023 21:22.18
Full logs for this script are available at /tmp/user.scripts/tmpScripts/Unraid - Backup appdata/log.txt
Hi sorry that I have to open a new issue. This is the same issue as #61 but it was already closed. The new commit does not work and I still have the error in Sonarr:
NzbDrone.Core.Datastore.ModelNotFoundException: Series with ID 0 does not exist
at NzbDrone.Core.Datastore.BasicRepository`1[TModel].Get (System.Int32 id) [0x00021] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\BasicRepository.cs:85
at NzbDrone.Core.Tv.SeriesService.GetSeries (System.Int32 seriesId) [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Tv\SeriesService.cs:58
at NzbDrone.Core.IndexerSearch.SeriesSearchService.Execute (NzbDrone.Core.IndexerSearch.SeriesSearchCommand message) [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\IndexerSearch\SeriesSearchService.cs:30
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) [0x000e0] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:96
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x0011e] in <69ada62907b24213a012734531df1db1>:0
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommands () [0x00027] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:41
Debug from upgradinator.py:
****************************************
* Script Input Validated *
****************************************
*********** Script Settings ************
Dry_run: False
Log Level: debug
****************************************
****************************************
Script Settings for radarr_1:
count: 5
tag_name: checked
reset: False
unattended: True
status: released
monitored: True
****************************************
****************************************
* radarr_1 *
****************************************
*************** Settings ***************
Instance Name: radarr_1
URL: http://xxx
api: ***************************84bca
Connected to Radarr v5.1.3.8246 at http://xxx
Tag Name: checked exists with tagId: 1, no need to create.
Add tag payload: {'movieIds': [45, 46, 47, 48, 49], 'tags': [1], 'applyTags': 'add'}
Search payload: {'name': 'MoviesSearch', 'movieIds': [45, 46, 47, 48, 49]}
Search request sent for 'Inception', this item has been tagged with 'checked'
Search request sent for 'Inside Out', this item has been tagged with 'checked'
Search request sent for 'Insidious', this item has been tagged with 'checked'
Search request sent for 'Doctor Strange', this item has been tagged with 'checked'
Search request sent for 'The Lorax', this item has been tagged with 'checked'
Total Movies: 757, Tagged Movies: 35 (4.62%), Untagged Movies: 722 (95.38%)
****************************************
Script Settings for sonarr_1:
count: 5
tag_name: checked
reset: False
unattended: True
status: ['continuing', 'ended']
monitored: True
****************************************
****************************************
* sonarr_1 *
****************************************
*************** Settings ***************
Instance Name: sonarr_1
URL: http://xxx
api: ***************************2d06e
Connected to Sonarr v3.0.10.1567 at http://xxx
Tag Name: checked exists with tagId: 1, no need to create.
Add tag payload: {'seriesIds': [86, 89, 90, 92, 93], 'tags': [1], 'applyTags': 'add'}
Search payload: {'name': 'SeriesSearch', 'seriesIds': [86, 89, 90, 92, 93]}
Search request sent for 'Citadel', this item has been tagged with 'checked'
Search request sent for 'Succession', this item has been tagged with 'checked'
Search request sent for 'From', this item has been tagged with 'checked'
Search request sent for 'Blue Planet II', this item has been tagged with 'checked'
Search request sent for 'Invasion (2021)', this item has been tagged with 'checked'
Total Series: 50, Tagged Series: 35 (70.00%), Untagged Series: 15 (30.00%)
Can you pls take a look at this again? Thank you so much!
Title says it all
Idea to improve Renaminatorr with a new/novel feature.
This will require a listening port be locally open on DAPS to listen to a trigger from any *arr app similar to how autoscan works.
How Autoscan works:
1. New media imported or upgraded or renamed in *Arr
2. *Arr sends a command to Autoscan which includes the path to the media
3. Autoscan receives command....and tells Plex to scan that EXACT folder instead of an entire library
4. Tons of people do this to improve Plex, especially when Sonarr/Radarr renames content.
How renaminatorr trigger could work:
1. Same as above
2. Same as above
3. Renaminatorr receives command....media path analysis identifies which *arr instance sent the command and tells the *Arr instance to update root folder and/or filenames for that specific show/movie.
Keep the current flow of renaminatorr blindly pushing through entire *arr instances updating/renaming.....but also include this feature to receive a bit more intuitive/intelligent updates/rename actions!
Inspiration for this came when 3 Body Problem (2024)
released. Brand new show....Episode Name entries in Sonarr at time of import were all just TBA -- but only because I had added this Show into Sonarr weeks ago.
Would have been cool if some Script just magically knew to update/rename this Show in Sonarr since a new episode was downloaded for it.
I have a use case for having the option of ignoring specific movies/series to poster_cleanarr and currently from what I can tell only ignoring collections is supported. If possible it would be nice addition thanks!
Currently this script seems to always chown the config dir to the provided UID and GID, and chmod to 777. config.yml contains sensitive information and should have an option to be less permissive (say 600 or 660). Perhaps a quick and simple solution could be to have the automatic chown and chmod disable if an environment variable is set and assume any user who uses said variable knows what they're doing permission wise?
Sorry I'm basically technologically illiterate and I didn't know if you had a discord server somewhere. So I setup the docker on unraid for using upgradinatorr exclusively and the first run worked perfectly with no log errors. However all subsequent hourly runs had this error in the log file. Can you tell me what I did wrong and how to fix it?
03/31/24 10:00 AM INFO:
************************ UPGRADINATORR Version: 1.1.0 ************************
03/31/24 10:00 AM INFO:
*************************** STARTING UPGRADINATORR ***************************
03/31/24 10:00 AM ERROR:
An error occurred:
Traceback (most recent call last):
File "/app/modules/upgradinatorr.py", line 311, in main
valid = validate(config, script_config, logger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/util/utility.py", line 695, in validate
list_of_instance_keys = [sub_key for key in config.instances_config.keys() for sub_key in config.instances_config[key].keys()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/util/utility.py", line 695, in
list_of_instance_keys = [sub_key for key in config.instances_config.keys() for sub_key in config.instances_config[key].keys()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'keys'
03/31/24 10:00 AM ERROR:
03/31/24 10:00 AM INFO:
**************************** END OF UPGRADINATORR ****************************
List containers and assiciated config directory to stop and backup
empty, the script will stop.assiciated
be associated
?I use renamer to copy posters to an output dir and then run fix_border and have that copy the posters to the PMM assests dir.
To clean them both, I now have 2 renamer cleanarr scripts and config entries.
It would be nice if we could combine this into one.
My current setup works, so no rush, just wanted to drop this here.
Is it possible to implement a way to get DAPS to send a Gotify notification after a succesful run?
Unmatched assets will put tv shows in movies if there aren't any subfolders in the media's directory.
Appdata backup script should ensure that docker is running before running the script. This could cause issues.
Got the appdata backup script working few days ago, but don't know if i use it wrong, if i've misunderstood or if it's a bug.
Got a docker-compose.yml file per service, stored alongside the corresponding /config folder.
When running the script, only /config folder is backed up, compose file is not included.
Is that intended ?
Currently only movies are being excluded would like for collections to be as well if possible. Thanks!
I swear I'm just having a brain fart here but I keep getting
✘ userscripts Error 0.5s
Error response from daemon: manifest unknown
when I try to pull or put the container up, not sure what I'm doing wrong.
version: "2.1"
services:
userscripts:
image: ghcr.io/drazzilb08/userscripts
container_name: userscripts
environment:
- PUID=1000
- PGID=1000
- TZ=America/Detroit
volumes:
- /opt/userscripts/config:/config
- /opt/plexmetamanager/assets/:/pmm
- /opt/posters/:/posters
- /opt/:/appdata
- /mnt/mergerfs/data/media/:/media
- /var/run/docker.sock:/var/run/docker.sock
- /mnt/mergerfs/data/Backups:/backup
restart: unless-stopped
Would be a nice addition to the unmatched_assets
script if we could split the log output in 10 or 20 individual segments (and if possible number them).
That makes it easy for a poster maker to claim a portion so we don't all work on the same first ones in the log.
This idea was raised after a Discord discussion starting here:
https://discord.com/channels/492590071455940612/1213806644245569578/1226915811449376799
When using renamer.py the script will only use the override directory if the file name in the override and source directories match, even if the override directory is a closer match to the *arr folder.
dev v1.0.4
Reproduce problem:
(I specifically witnessed this issue while setting poster_renamerr
to run
in the schedule:
)
Add support for multiple instances
Use the config setup of upgradinatorr
Hi thank you so much for this awesome script! I have configured it to upgrade my movies and tv's and followed the trash guide to set up my Radarr and Sonarr instances for good quality materials.
When I run upgradinatorr.py, Radarr works well. It will start looking for movies. However, I got this exception in Sonarr:
NzbDrone.Core.Datastore.ModelNotFoundException: Series with ID 0 does not exist
at NzbDrone.Core.Datastore.BasicRepository`1[TModel].Get (System.Int32 id) [0x00021] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Datastore\BasicRepository.cs:85
at NzbDrone.Core.Tv.SeriesService.GetSeries (System.Int32 seriesId) [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Tv\SeriesService.cs:58
at NzbDrone.Core.IndexerSearch.SeriesSearchService.Execute (NzbDrone.Core.IndexerSearch.SeriesSearchCommand message) [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\IndexerSearch\SeriesSearchService.cs:30
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[TCommand] (TCommand command, NzbDrone.Core.Messaging.Commands.CommandModel commandModel) [0x000e0] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:96
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x00035] in <69ada62907b24213a012734531df1db1>:0
at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,NzbDrone.Core.Messaging.Commands.CommandExecutor,object,NzbDrone.Core.Messaging.Commands.CommandModel)
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommands () [0x00027] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Messaging\Commands\CommandExecutor.cs:41
I have Sonarr configured as follows:
sonarr:
- name: sonarr_1
count: 5
monitored: true
status:
- continuing
- ended
tag_name: checked
unattended: true
reset: false
What can be the cause of the exception? Thanks in advance!
Updated backup-appdata script to v4 with new config.
Now getting this error when running the script on a Syno, any way around this error?
jq: error (at <stdin>:1): jq was compiled without ONIGURUMA regex libary. match/test/sub and related functions are not available. jq: error (at <stdin>:1): jq was compiled without ONIGURUMA regex libary. match/test/sub and related functions are not available. Container unpackerr does not use appdata, skipping over.
Current unmatched assets only supports jpg files.
In title
I would like upgradinatorr to check multiple status for upgrades.
For example, in Sonarr I would like it to check both "continuing" and "ended" ( not much point in checking upcoming)
Would it be possible to add more than one status to be checked?
if you add a container that actually doesn't exist like in my case lidarr, it stops the script.
Error:
Traceback (most recent call last):
File "/home/ronald/userScripts/modules/poster_renamerr.py", line 642, in main
results = handle_starr_data(app, server_name, instance_type, include_episode=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ronald/userScripts/util/utility.py", line 574, in handle_starr_data
'season_pack': season['statistics']['episodeCount'] == season['statistics']['totalEpisodeCount'],
~~~~~~^^^^^^^^^^^^^^
KeyError: 'statistics'
Looks like this section of code causes it:
Lines 571 to 577 in c86f81f
I did some fairly basic debugging on my end (since my Python is not so great) to make it print out the season_data for each series it iterates over in the Sonarr instance which is causing the above error.
Mysterious Disappearances
{'nextAiring': '2024-05-08T13:30:00Z', 'previousAiring': '2024-05-01T13:30:00Z', 'episodeFileCount': 4, 'episodeCount': 4, 'totalEpisodeCount': 12, 'sizeOnDisk': 5784786625, 'releaseGroups
--------
Stardust Telepath
{'episodeFileCount': 0, 'episodeCount': 0, 'totalEpisodeCount': 12, 'sizeOnDisk': 0, 'releaseGroups': [], 'percentOfEpisodes': 0}
--------
BARTENDER: Glass of God
{'episodeFileCount': 0, 'episodeCount': 0, 'totalEpisodeCount': 12, 'sizeOnDisk': 0, 'releaseGroups': [], 'percentOfEpisodes': 0}
--------
Kamichu!
None
{'episodeFileCount': 16, 'episodeCount': 16, 'totalEpisodeCount': 16, 'sizeOnDisk': 9769174000, 'releaseGroups': ['Judgment'], 'percentOfEpisodes': 100}
In my case one of the series causing an error seems to be Kamichu!
which seems to be lacking a statisctics
key for Season 0 (Specials).
I can see that this series has an entry for Specials
but no episodes in there, so a bit of an edge case.
No clue how to update the code elegantly to handle this, maybe by using dict.get
instead of just grabbing the statistics
key? In my debugging modifications this got it to print out None
instead of getting a KeyError
Just an FYI latest renamer script has a bit of a bug with asset_folders and deleting old files in favor of an override.
If you set unraid_notify=yes
it gives the following error
/tmp/user.scripts/tmpScripts/3.Backup-Appdata Drazzilb/script: line 525: /usr/local/emhttp/plugins/dynamix/scripts/unraid_notify: No such file or directory
Discord error notification sent.
{"embeds": ["0"]}
Discord notification sent.
in my case i don't have unraid_notify but i do have notify in that location
It would be pretty neat to filter out what gets upgraded. I see that an old issue #58 has been opened about this with a merge, but I don't see a way to do that in the new version. (feel free to correct me if I'm wrong)
Looking forward for your input, and thank you for these wonderful set of scripts.
Reminder about issue with Asset_Folders and names containing a . As discussed on discord.
Also
Blank ignore collections causes an error.
Remove /data mount from dockerfile as it is no longer needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.