Created
January 19, 2025 16:39
-
-
Save keriati/e87d24ba1d2442b3c6fa49dc380b1d8b to your computer and use it in GitHub Desktop.
Radarr database movie exporter script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DB_FILE="radarr.db" | |
OUTPUT_FILE="movies.json" | |
echo "[" > "$OUTPUT_FILE" | |
first=1 | |
sqlite3 -noheader "$DB_FILE" " | |
SELECT json_object('imdb', mm.ImdbId, 'tmdb', mm.TmdbId, 'title', mm.Title) | |
FROM MovieMetadata mm | |
INNER JOIN Movies m ON m.MovieMetadataId = mm.Id | |
WHERE mm.ImdbId IS NOT NULL AND mm.TmdbId IS NOT NULL AND mm.Title IS NOT NULL; | |
" | while IFS= read -r row_json; do | |
if [ $first -eq 1 ]; then | |
echo " $row_json" >> "$OUTPUT_FILE" | |
first=0 | |
else | |
echo " ,$row_json" >> "$OUTPUT_FILE" | |
fi | |
done | |
echo "]" >> "$OUTPUT_FILE" | |
echo "Export complete: $OUTPUT_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script exports the list of movies from Radarr.
It needs the radarr.db file that can be extracted from a radarr backup.
The movies.json can then be imported to another Radarr instance using an import list with the format StevenLu Custom.
(the movies.json needs to be hosted for this on a URL)