1
0
mirror of https://github.com/mitb-archive/filebot synced 2025-03-09 22:09:47 -04:00
This commit is contained in:
Reinhard Pointner 2016-02-05 15:21:10 +00:00
parent 3152a69152
commit 15962f548b

View File

@ -1,37 +1,24 @@
#!/bin/sh #!/bin/sh
echo 'Fetch TVDB dump' fetch()
DUMP='tvdb.zip' {
LINK='http://thetvdb.com/api/58B4AA94C59AD656/updates/updates_all.zip' FILE="$1"
if [ ! -f "$DUMP" ] || test "`find $DUMP -mtime +5`"; then LINK="$2"
curl -L -o "$DUMP" -z "$DUMP" "$LINK" TIME="$3"
unzip -o "$DUMP"
fi
echo 'Fetch AniDB dump' echo "Fetch $FILE"
DUMP='anidb.gz' if [ ! -f "$FILE" ] || test "`find $FILE -mtime $TIME`"; then
TEXT='anidb.txt' curl -L -o "$FILE" -z "$FILE" "$LINK"
LINK='http://anidb.net/api/anime-titles.dat.gz'
if [ ! -f "$DUMP" ] || test "`find $DUMP -mtime +5`"; then
curl -L -o "$DUMP" -z "$DUMP" "$LINK"
gunzip -c "$DUMP" > "$TEXT"
fi fi
}
echo 'Fetch OSDB dump' fetch anidb.txt.gz 'http://anidb.net/api/anime-titles.dat.gz' +5
DUMP='osdb.gz' fetch tvdb.zip 'http://thetvdb.com/api/58B4AA94C59AD656/updates/updates_all.zip' +5
TEXT='osdb.txt' fetch omdb.zip 'http://beforethecode.com/projects/omdb/download.aspx?e=reinhard.pointner%40gmail.com&tsv=movies' +30
LINK='http://www.opensubtitles.org/addons/export_movie.php' fetch osdb.txt 'http://www.opensubtitles.org/addons/export_movie.php' +30
if [ ! -f "$DUMP" ] || test "`find $DUMP -mtime +30`"; then
curl -L -o "$DUMP" -z "$DUMP" "$LINK" -sH 'Accept-encoding: gzip'
gunzip -c "$DUMP" > "$TEXT"
fi
echo 'Fetch OMDB dump' gunzip -k -f anidb.txt.gz
DUMP='omdb.zip' unzip -o tvdb.zip
LINK='http://beforethecode.com/projects/omdb/download.aspx?e=reinhard.pointner%40gmail.com&tsv=movies' unzip -o omdb.zip
if [ ! -f "$DUMP" ] || test "`find $DUMP -mtime +30`"; then
curl -L -o "$DUMP" -z "$DUMP" "$LINK"
unzip -o "$DUMP"
fi
echo 'DONE' echo 'DONE'