filebot/build-data/build-data-import.sh

34 lines
1010 B
Bash
Raw Normal View History

2015-05-11 10:35:45 +00:00
#!/bin/sh
2015-05-11 18:45:02 +00:00
# initialize dump files if necessary
2015-05-11 10:35:45 +00:00
for DUMP in "omdb.zip" "tvdb.zip" "anidb.gz" "osdb.gz"
do
if [ ! -f "$DUMP" ]; then
2015-05-11 19:23:54 +00:00
touch -a -m -d '1970-01-01 0:00:00' "$DUMP"
2015-05-11 10:35:45 +00:00
fi
done
echo 'Fetch OMDB dump'
2015-05-11 18:45:02 +00:00
if test "`find omdb.zip -mtime +30`"; then
2015-05-11 10:35:45 +00:00
curl -L -o omdb.zip -z omdb.zip "http://beforethecode.com/projects/omdb/download.aspx?e=reinhard.pointner%40gmail.com&tsv=movies"
unzip -o omdb.zip
fi
echo 'Fetch TVDB dump'
if test "`find tvdb.zip -mtime +5`"; then
curl -L -o tvdb.zip -z tvdb.zip "http://thetvdb.com/api/58B4AA94C59AD656/updates/updates_all.zip"
unzip -o tvdb.zip
fi
echo 'Fetch AniDB dump'
if test "`find anidb.gz -mtime +5`"; then
curl -L -o anidb.gz -z anidb.gz "http://anidb.net/api/anime-titles.dat.gz"
2015-05-11 18:45:02 +00:00
gunzip -c anidb.gz > anidb.txt
2015-05-11 10:35:45 +00:00
fi
echo 'Fetch OSDB dump'
2015-05-11 18:45:02 +00:00
if test "`find osdb.gz -mtime +30`"; then
2015-05-11 10:35:45 +00:00
curl -L -o osdb.gz -z osdb.gz "http://www.opensubtitles.org/addons/export_movie.php" -sH 'Accept-encoding: gzip'
gunzip -c osdb.gz > osdb.txt
fi