* update amc script and movie detection data
@see http://filebot.sourceforge.net/forums/viewtopic.php?f=4&t=566
This commit is contained in:
parent
c0dc78fbd6
commit
883c684bac
|
@ -5,6 +5,7 @@
|
||||||
@Grab(group='org.jsoup', module='jsoup', version='1.7.1')
|
@Grab(group='org.jsoup', module='jsoup', version='1.7.1')
|
||||||
import org.jsoup.*
|
import org.jsoup.*
|
||||||
|
|
||||||
|
/*
|
||||||
def sgl = []
|
def sgl = []
|
||||||
for (def page = 0; true; page++) {
|
for (def page = 0; true; page++) {
|
||||||
def dom = Jsoup.parse(new URL('http://scenegrouplist.com/lists_sgl.php?pageNum_RSSGL=' + page), 10000)
|
def dom = Jsoup.parse(new URL('http://scenegrouplist.com/lists_sgl.php?pageNum_RSSGL=' + page), 10000)
|
||||||
|
@ -17,6 +18,7 @@ sgl = sgl.collect{ it.before(/ - /).trim().space('.') }.collect{ it ==~ /\p{Uppe
|
||||||
|
|
||||||
// append release group names
|
// append release group names
|
||||||
new File('website/data/release-groups.txt') << '\n' << sgl.join('\n')
|
new File('website/data/release-groups.txt') << '\n' << sgl.join('\n')
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------- //
|
// ------------------------------------------------------------------------- //
|
||||||
|
|
|
@ -841,7 +841,7 @@ public class MediaDetection {
|
||||||
|
|
||||||
public static void storeMetaInfo(File file, Object model) {
|
public static void storeMetaInfo(File file, Object model) {
|
||||||
// only for Episode / Movie objects
|
// only for Episode / Movie objects
|
||||||
if (model instanceof Episode || model instanceof Movie) {
|
if ((model instanceof Episode || model instanceof Movie) && file.exists()) {
|
||||||
MetaAttributes xattr = new MetaAttributes(file);
|
MetaAttributes xattr = new MetaAttributes(file);
|
||||||
|
|
||||||
// store original name and model as xattr
|
// store original name and model as xattr
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# source names mostly copied from [http://en.wikipedia.org/wiki/Pirated_movie_release_types]
|
# source names mostly copied from [http://en.wikipedia.org/wiki/Pirated_movie_release_types]
|
||||||
pattern.video.source: CAMRip|CAM|PDVD|TS|TELESYNC|PDVD|PPV|PPVRip|Screener|SCR|SCREENER|DVDSCR|DVDSCREENER|BDSCR|R4|R5|R5LINE|R5.LINE|DVD|DVDRip|DVDR|TVRip|DSR|PDTV|SDTV|HDTV|DVB|DVBRip|DTHRip|VODRip|VODR|BDRip|BRRip|BluRay|BDR|BR-Scr|BR-Screener|HDDVD|HDRip|WorkPrint|VHS|VCD|TELECINE|WEB-DL|WEBRip|ithd|iTunesHD
|
pattern.video.source: CAMRip|CAM|PDVD|TS|TELESYNC|PDVD|PPV|PPVRip|Screener|SCR|SCREENER|DVDSCR|DVDSCREENER|BDSCR|R4|R5|R5LINE|R5.LINE|DVD|DVDRip|DVDR|TVRip|DSR|PDTV|SDTV|HDTV|DVB|DVBRip|DTHRip|VODRip|VODR|BDRip|BRRip|BluRay|BDR|BR.Scr|BR.Screener|HDDVD|HDRip|WorkPrint|VHS|VCD|TELECINE|WEB.DL|WEBRip|ithd|iTunesHD
|
||||||
|
|
||||||
# additional release info patterns
|
# additional release info patterns
|
||||||
pattern.video.format: DivX|Xvid|AVC|x264|h264|3ivx|mpeg|mpeg4|mp3|aac|ac3|dd20|dd51|2ch|6ch|DTS|WS|HR|7p|720p|18p|1080p|NTSC
|
pattern.video.format: DivX|Xvid|AVC|x264|h264|3ivx|mpeg|mpeg4|mp3|aac|ac3|dd20|dd51|2ch|6ch|DTS|WS|HR|7p|720p|18p|1080p|NTSC
|
||||||
|
|
|
@ -188,6 +188,7 @@ Snapshots
|
||||||
SPA
|
SPA
|
||||||
Spanish
|
Spanish
|
||||||
Special.Edition
|
Special.Edition
|
||||||
|
Stephen.Kings
|
||||||
Sub
|
Sub
|
||||||
SUBBED
|
SUBBED
|
||||||
Subs
|
Subs
|
||||||
|
|
|
@ -223,6 +223,7 @@ BRiGHT
|
||||||
BRMP
|
BRMP
|
||||||
BRUTUS
|
BRUTUS
|
||||||
BRZONE
|
BRZONE
|
||||||
|
BS
|
||||||
BTSD
|
BTSD
|
||||||
BTSFilms
|
BTSFilms
|
||||||
BTT
|
BTT
|
||||||
|
@ -1105,6 +1106,7 @@ POD
|
||||||
POKERUS
|
POKERUS
|
||||||
PoRNDoCtOR
|
PoRNDoCtOR
|
||||||
PORNOHOLiCS
|
PORNOHOLiCS
|
||||||
|
PorphyriA
|
||||||
PosTX
|
PosTX
|
||||||
PoT
|
PoT
|
||||||
PoTuS
|
PoTuS
|
||||||
|
@ -1410,7 +1412,6 @@ TFE
|
||||||
tff
|
tff
|
||||||
TFiN
|
TFiN
|
||||||
TGP
|
TGP
|
||||||
THE
|
|
||||||
The3DTeam
|
The3DTeam
|
||||||
TheBatman
|
TheBatman
|
||||||
TheNewSquad
|
TheNewSquad
|
||||||
|
|
|
@ -83,7 +83,7 @@ if (args.empty) {
|
||||||
input = input.flatten()
|
input = input.flatten()
|
||||||
|
|
||||||
// extract archives (zip, rar, etc) that contain at least one video file
|
// extract archives (zip, rar, etc) that contain at least one video file
|
||||||
def tempFiles = extract(file: input.findAll{ it.isArchive() }, output: null, conflict: 'override', filter: { it.isVideo() || (music && it.isAudio()) }, forceExtractAll: true)
|
def tempFiles = extract(file: input.findAll{ it.isArchive() }, output: null, conflict: 'override', filter: { it.isVideo() || (music && it.isAudio()) }, forceExtractAll: true) ?: []
|
||||||
input += tempFiles
|
input += tempFiles
|
||||||
|
|
||||||
// sanitize input
|
// sanitize input
|
||||||
|
@ -154,7 +154,7 @@ groups.each{ group, files ->
|
||||||
// fetch subtitles (but not for anime)
|
// fetch subtitles (but not for anime)
|
||||||
if (subtitles && !group.anime) {
|
if (subtitles && !group.anime) {
|
||||||
subtitles.each{ languageCode ->
|
subtitles.each{ languageCode ->
|
||||||
def subtitleFiles = getMissingSubtitles(file:files, output:'srt', encoding:'UTF-8', lang:languageCode)
|
def subtitleFiles = getMissingSubtitles(file:files, output:'srt', encoding:'UTF-8', lang:languageCode) ?: []
|
||||||
files += subtitleFiles
|
files += subtitleFiles
|
||||||
tempFiles += subtitleFiles // if downloaded for temporarily extraced files delete later
|
tempFiles += subtitleFiles // if downloaded for temporarily extraced files delete later
|
||||||
}
|
}
|
||||||
|
@ -168,11 +168,11 @@ groups.each{ group, files ->
|
||||||
def dest = rename(file: files, format: config.format, db: config.db)
|
def dest = rename(file: files, format: config.format, db: config.db)
|
||||||
if (dest && artwork) {
|
if (dest && artwork) {
|
||||||
dest.mapByFolder().each{ dir, fs ->
|
dest.mapByFolder().each{ dir, fs ->
|
||||||
println "Fetching artwork for $dir from TheTVDB"
|
_log.finest "Fetching artwork for $dir from TheTVDB"
|
||||||
def sxe = fs.findResult{ eps -> parseEpisodeNumber(eps) }
|
def sxe = fs.findResult{ eps -> parseEpisodeNumber(eps) }
|
||||||
def options = TheTVDB.search(config.name)
|
def options = TheTVDB.search(config.name)
|
||||||
if (options.isEmpty()) {
|
if (options.isEmpty()) {
|
||||||
println "TV Series not found: $config.name"
|
_log.warning "TV Series not found: $config.name"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
options = options.sortBySimilarity(config.name, { s -> s.name })
|
options = options.sortBySimilarity(config.name, { s -> s.name })
|
||||||
|
@ -189,7 +189,7 @@ groups.each{ group, files ->
|
||||||
def dest = rename(file:files, format:format.mov, db:'TheMovieDB')
|
def dest = rename(file:files, format:format.mov, db:'TheMovieDB')
|
||||||
if (dest && artwork) {
|
if (dest && artwork) {
|
||||||
dest.mapByFolder().each{ dir, fs ->
|
dest.mapByFolder().each{ dir, fs ->
|
||||||
println "Fetching artwork for $dir from TheMovieDB"
|
_log.finest "Fetching artwork for $dir from TheMovieDB"
|
||||||
fetchMovieArtworkAndNfo(dir, group.mov, fs.findAll{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }, backdrops)
|
fetchMovieArtworkAndNfo(dir, group.mov, fs.findAll{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }, backdrops)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ if (exec) {
|
||||||
// make XMBC scan for new content and display notification message
|
// make XMBC scan for new content and display notification message
|
||||||
if (xbmc) {
|
if (xbmc) {
|
||||||
xbmc.each{ host ->
|
xbmc.each{ host ->
|
||||||
println "Notify XBMC: $host"
|
_log.info "Notify XBMC: $host"
|
||||||
_guarded{
|
_guarded{
|
||||||
showNotification(host, 9090, 'FileBot', "Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).", 'http://filebot.sourceforge.net/images/icon.png')
|
showNotification(host, 9090, 'FileBot', "Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).", 'http://filebot.sourceforge.net/images/icon.png')
|
||||||
scanVideoLibrary(host, 9090)
|
scanVideoLibrary(host, 9090)
|
||||||
|
@ -235,14 +235,14 @@ if (xbmc) {
|
||||||
// make Plex scan for new content
|
// make Plex scan for new content
|
||||||
if (plex) {
|
if (plex) {
|
||||||
plex.each{
|
plex.each{
|
||||||
println "Notify Plex: $it"
|
_log.info "Notify Plex: $it"
|
||||||
refreshPlexLibrary(it)
|
refreshPlexLibrary(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark episodes as 'acquired'
|
// mark episodes as 'acquired'
|
||||||
if (myepisodes) {
|
if (myepisodes) {
|
||||||
println 'Update MyEpisodes'
|
_log.info 'Update MyEpisodes'
|
||||||
include('fn:update-mes', [login:myepisodes.join(':'), addshows:true], getRenameLog().values())
|
include('fn:update-mes', [login:myepisodes.join(':'), addshows:true], getRenameLog().values())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ if (pushover) {
|
||||||
// include webservice utility
|
// include webservice utility
|
||||||
include('fn:lib/ws')
|
include('fn:lib/ws')
|
||||||
|
|
||||||
println('Sending Pushover notification')
|
_log.info 'Sending Pushover notification'
|
||||||
Pushover(pushover).send("Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).")
|
Pushover(pushover).send("Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,19 +293,19 @@ if (gmail) {
|
||||||
|
|
||||||
// clean empty folders, clutter files, etc after move
|
// clean empty folders, clutter files, etc after move
|
||||||
if (clean) {
|
if (clean) {
|
||||||
if (['COPY', 'HARDLINK'].find{ it.equalsIgnoreCase(_args.action) } && tempFiles?.size() > 0) {
|
if (['COPY', 'HARDLINK'].find{ it.equalsIgnoreCase(_args.action) } && tempFiles.size() > 0) {
|
||||||
println 'Clean temporary extracted files'
|
_log.info 'Clean temporary extracted files'
|
||||||
// delete extracted files
|
// delete extracted files
|
||||||
tempFiles.each{
|
tempFiles.each{
|
||||||
if(it.isFile()) {
|
if(it.isFile()) {
|
||||||
println "Delete $it"
|
_log.finest "Delete $it"
|
||||||
it.delete()
|
it.delete()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// delete remaining empty folders
|
// delete remaining empty folders
|
||||||
tempFiles*.dir.unique().findAll{ it.listFiles().length == 0 }.each{
|
tempFiles*.dir.unique().findAll{ it.listFiles().length == 0 }.each{
|
||||||
if(it.isDirectory()) {
|
if(it.isDirectory()) {
|
||||||
println "Delete $it"
|
_log.finest "Delete $it"
|
||||||
it.delete()
|
it.delete()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ if (clean) {
|
||||||
|
|
||||||
// deleting remaining files only makes sense after moving files
|
// deleting remaining files only makes sense after moving files
|
||||||
if ('MOVE'.equalsIgnoreCase(_args.action)) {
|
if ('MOVE'.equalsIgnoreCase(_args.action)) {
|
||||||
println 'Clean clutter files and empty folders'
|
_log.info 'Clean clutter files and empty folders'
|
||||||
include('fn:cleaner', [:], !args.empty ? args : ut_kind == 'multi' && ut_dir ? [ut_dir as File] : [])
|
include('fn:cleaner', [:], !args.empty ? args : ut_kind == 'multi' && ut_dir ? [ut_dir as File] : [])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,32 +43,32 @@ def refreshPlexLibrary(server, port = 32400) {
|
||||||
*/
|
*/
|
||||||
def fetchSeriesBanner(outputFile, series, bannerType, bannerType2, season, override, locale) {
|
def fetchSeriesBanner(outputFile, series, bannerType, bannerType2, season, override, locale) {
|
||||||
if (outputFile.exists() && !override) {
|
if (outputFile.exists() && !override) {
|
||||||
println "Banner already exists: $outputFile"
|
_log.finest "Banner already exists: $outputFile"
|
||||||
return outputFile
|
return outputFile
|
||||||
}
|
}
|
||||||
|
|
||||||
// select and fetch banner
|
// select and fetch banner
|
||||||
def banner = [locale, null].findResult { TheTVDB.getBanner(series, [BannerType:bannerType, BannerType2:bannerType2, Season:season, Language:it]) }
|
def banner = [locale, null].findResult { TheTVDB.getBanner(series, [BannerType:bannerType, BannerType2:bannerType2, Season:season, Language:it]) }
|
||||||
if (banner == null) {
|
if (banner == null) {
|
||||||
println "Banner not found: $outputFile / $bannerType:$bannerType2"
|
_log.finest "Banner not found: $outputFile / $bannerType:$bannerType2"
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
println "Fetching $outputFile => $banner"
|
_log.finest "Fetching $outputFile => $banner"
|
||||||
return banner.url.saveAs(outputFile)
|
return banner.url.saveAs(outputFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
def fetchSeriesFanart(outputFile, series, type, season, override, locale) {
|
def fetchSeriesFanart(outputFile, series, type, season, override, locale) {
|
||||||
if (outputFile.exists() && !override) {
|
if (outputFile.exists() && !override) {
|
||||||
println "Fanart already exists: $outputFile"
|
_log.finest "Fanart already exists: $outputFile"
|
||||||
return outputFile
|
return outputFile
|
||||||
}
|
}
|
||||||
|
|
||||||
def fanart = [locale, null].findResult{ lang -> FanartTV.getSeriesArtwork(series.seriesId).find{ type == it.type && (season == null || season == it.season) && (lang == null || lang == it.language) }}
|
def fanart = [locale, null].findResult{ lang -> FanartTV.getSeriesArtwork(series.seriesId).find{ type == it.type && (season == null || season == it.season) && (lang == null || lang == it.language) }}
|
||||||
if (fanart == null) {
|
if (fanart == null) {
|
||||||
println "Fanart not found: $outputFile / $type"
|
_log.finest "Fanart not found: $outputFile / $type"
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
println "Fetching $outputFile => $fanart"
|
_log.finest "Fetching $outputFile => $fanart"
|
||||||
return fanart.url.saveAs(outputFile)
|
return fanart.url.saveAs(outputFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ def fetchSeriesArtworkAndNfo(seriesDir, seasonDir, series, season, override = fa
|
||||||
*/
|
*/
|
||||||
def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
|
def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
|
||||||
if (outputFile.exists() && !override) {
|
if (outputFile.exists() && !override) {
|
||||||
println "Artwork already exists: $outputFile"
|
_log.finest "Artwork already exists: $outputFile"
|
||||||
return outputFile
|
return outputFile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,10 +149,10 @@ def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
|
||||||
def artwork = TheMovieDB.getArtwork(movieInfo.id as String)
|
def artwork = TheMovieDB.getArtwork(movieInfo.id as String)
|
||||||
def selection = [locale.language, 'en', null].findResult{ l -> artwork.find{ (l == it.language || l == null) && it.category == category } }
|
def selection = [locale.language, 'en', null].findResult{ l -> artwork.find{ (l == it.language || l == null) && it.category == category } }
|
||||||
if (selection == null) {
|
if (selection == null) {
|
||||||
println "Artwork not found: $outputFile"
|
_log.finest "Artwork not found: $outputFile"
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
println "Fetching $outputFile => $selection"
|
_log.finest "Fetching $outputFile => $selection"
|
||||||
return selection.url.saveAs(outputFile)
|
return selection.url.saveAs(outputFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,15 +161,15 @@ def fetchAllMovieArtwork(outputFolder, movieInfo, category, override, locale) {
|
||||||
def artwork = TheMovieDB.getArtwork(movieInfo.id as String)
|
def artwork = TheMovieDB.getArtwork(movieInfo.id as String)
|
||||||
def selection = [locale.language, 'en', null].findResults{ l -> artwork.findAll{ (l == it.language || l == null) && it.category == category } }.flatten().findAll{ it?.url }.unique()
|
def selection = [locale.language, 'en', null].findResults{ l -> artwork.findAll{ (l == it.language || l == null) && it.category == category } }.flatten().findAll{ it?.url }.unique()
|
||||||
if (selection == null) {
|
if (selection == null) {
|
||||||
println "Artwork not found: $outputFolder"
|
_log.finest "Artwork not found: $outputFolder"
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
selection.eachWithIndex{ s, i ->
|
selection.eachWithIndex{ s, i ->
|
||||||
def outputFile = new File(outputFolder, "$category-${(i+1).pad(2)}.jpg")
|
def outputFile = new File(outputFolder, "$category-${(i+1).pad(2)}.jpg")
|
||||||
if (outputFile.exists() && !override) {
|
if (outputFile.exists() && !override) {
|
||||||
println "Artwork already exists: $outputFile"
|
_log.finest "Artwork already exists: $outputFile"
|
||||||
} else {
|
} else {
|
||||||
println "Fetching $outputFile => $s"
|
_log.finest "Fetching $outputFile => $s"
|
||||||
s.url.saveAs(outputFile)
|
s.url.saveAs(outputFile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,16 +177,16 @@ def fetchAllMovieArtwork(outputFolder, movieInfo, category, override, locale) {
|
||||||
|
|
||||||
def fetchMovieFanart(outputFile, movieInfo, type, diskType, override, locale) {
|
def fetchMovieFanart(outputFile, movieInfo, type, diskType, override, locale) {
|
||||||
if (outputFile.exists() && !override) {
|
if (outputFile.exists() && !override) {
|
||||||
println "Fanart already exists: $outputFile"
|
_log.finest "Fanart already exists: $outputFile"
|
||||||
return outputFile
|
return outputFile
|
||||||
}
|
}
|
||||||
|
|
||||||
def fanart = [locale, null].findResult{ lang -> FanartTV.getMovieArtwork(movieInfo.id).find{ type == it.type && (diskType == null || diskType == it.diskType) && (lang == null || lang == it.language) }}
|
def fanart = [locale, null].findResult{ lang -> FanartTV.getMovieArtwork(movieInfo.id).find{ type == it.type && (diskType == null || diskType == it.diskType) && (lang == null || lang == it.language) }}
|
||||||
if (fanart == null) {
|
if (fanart == null) {
|
||||||
println "Fanart not found: $outputFile / $type"
|
_log.finest "Fanart not found: $outputFile / $type"
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
println "Fetching $outputFile => $fanart"
|
_log.finest "Fetching $outputFile => $fanart"
|
||||||
return fanart.url.saveAs(outputFile)
|
return fanart.url.saveAs(outputFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue