* 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')
|
||||
import org.jsoup.*
|
||||
|
||||
/*
|
||||
def sgl = []
|
||||
for (def page = 0; true; page++) {
|
||||
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
|
||||
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) {
|
||||
// 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);
|
||||
|
||||
// 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]
|
||||
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
|
||||
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
|
||||
Spanish
|
||||
Special.Edition
|
||||
Stephen.Kings
|
||||
Sub
|
||||
SUBBED
|
||||
Subs
|
||||
|
|
|
@ -223,6 +223,7 @@ BRiGHT
|
|||
BRMP
|
||||
BRUTUS
|
||||
BRZONE
|
||||
BS
|
||||
BTSD
|
||||
BTSFilms
|
||||
BTT
|
||||
|
@ -1105,6 +1106,7 @@ POD
|
|||
POKERUS
|
||||
PoRNDoCtOR
|
||||
PORNOHOLiCS
|
||||
PorphyriA
|
||||
PosTX
|
||||
PoT
|
||||
PoTuS
|
||||
|
@ -1410,7 +1412,6 @@ TFE
|
|||
tff
|
||||
TFiN
|
||||
TGP
|
||||
THE
|
||||
The3DTeam
|
||||
TheBatman
|
||||
TheNewSquad
|
||||
|
|
|
@ -83,7 +83,7 @@ if (args.empty) {
|
|||
input = input.flatten()
|
||||
|
||||
// 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
|
||||
|
||||
// sanitize input
|
||||
|
@ -154,7 +154,7 @@ groups.each{ group, files ->
|
|||
// fetch subtitles (but not for anime)
|
||||
if (subtitles && !group.anime) {
|
||||
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
|
||||
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)
|
||||
if (dest && artwork) {
|
||||
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 options = TheTVDB.search(config.name)
|
||||
if (options.isEmpty()) {
|
||||
println "TV Series not found: $config.name"
|
||||
_log.warning "TV Series not found: $config.name"
|
||||
return
|
||||
}
|
||||
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')
|
||||
if (dest && artwork) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ if (exec) {
|
|||
// make XMBC scan for new content and display notification message
|
||||
if (xbmc) {
|
||||
xbmc.each{ host ->
|
||||
println "Notify XBMC: $host"
|
||||
_log.info "Notify XBMC: $host"
|
||||
_guarded{
|
||||
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)
|
||||
|
@ -235,14 +235,14 @@ if (xbmc) {
|
|||
// make Plex scan for new content
|
||||
if (plex) {
|
||||
plex.each{
|
||||
println "Notify Plex: $it"
|
||||
_log.info "Notify Plex: $it"
|
||||
refreshPlexLibrary(it)
|
||||
}
|
||||
}
|
||||
|
||||
// mark episodes as 'acquired'
|
||||
if (myepisodes) {
|
||||
println 'Update MyEpisodes'
|
||||
_log.info 'Update MyEpisodes'
|
||||
include('fn:update-mes', [login:myepisodes.join(':'), addshows:true], getRenameLog().values())
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ if (pushover) {
|
|||
// include webservice utility
|
||||
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).")
|
||||
}
|
||||
|
||||
|
@ -293,19 +293,19 @@ if (gmail) {
|
|||
|
||||
// clean empty folders, clutter files, etc after move
|
||||
if (clean) {
|
||||
if (['COPY', 'HARDLINK'].find{ it.equalsIgnoreCase(_args.action) } && tempFiles?.size() > 0) {
|
||||
println 'Clean temporary extracted files'
|
||||
if (['COPY', 'HARDLINK'].find{ it.equalsIgnoreCase(_args.action) } && tempFiles.size() > 0) {
|
||||
_log.info 'Clean temporary extracted files'
|
||||
// delete extracted files
|
||||
tempFiles.each{
|
||||
if(it.isFile()) {
|
||||
println "Delete $it"
|
||||
_log.finest "Delete $it"
|
||||
it.delete()
|
||||
}
|
||||
}
|
||||
// delete remaining empty folders
|
||||
tempFiles*.dir.unique().findAll{ it.listFiles().length == 0 }.each{
|
||||
if(it.isDirectory()) {
|
||||
println "Delete $it"
|
||||
_log.finest "Delete $it"
|
||||
it.delete()
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ if (clean) {
|
|||
|
||||
// deleting remaining files only makes sense after moving files
|
||||
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] : [])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,32 +43,32 @@ def refreshPlexLibrary(server, port = 32400) {
|
|||
*/
|
||||
def fetchSeriesBanner(outputFile, series, bannerType, bannerType2, season, override, locale) {
|
||||
if (outputFile.exists() && !override) {
|
||||
println "Banner already exists: $outputFile"
|
||||
_log.finest "Banner already exists: $outputFile"
|
||||
return outputFile
|
||||
}
|
||||
|
||||
// select and fetch banner
|
||||
def banner = [locale, null].findResult { TheTVDB.getBanner(series, [BannerType:bannerType, BannerType2:bannerType2, Season:season, Language:it]) }
|
||||
if (banner == null) {
|
||||
println "Banner not found: $outputFile / $bannerType:$bannerType2"
|
||||
_log.finest "Banner not found: $outputFile / $bannerType:$bannerType2"
|
||||
return null
|
||||
}
|
||||
println "Fetching $outputFile => $banner"
|
||||
_log.finest "Fetching $outputFile => $banner"
|
||||
return banner.url.saveAs(outputFile)
|
||||
}
|
||||
|
||||
def fetchSeriesFanart(outputFile, series, type, season, override, locale) {
|
||||
if (outputFile.exists() && !override) {
|
||||
println "Fanart already exists: $outputFile"
|
||||
_log.finest "Fanart already exists: $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) }}
|
||||
if (fanart == null) {
|
||||
println "Fanart not found: $outputFile / $type"
|
||||
_log.finest "Fanart not found: $outputFile / $type"
|
||||
return null
|
||||
}
|
||||
println "Fetching $outputFile => $fanart"
|
||||
_log.finest "Fetching $outputFile => $fanart"
|
||||
return fanart.url.saveAs(outputFile)
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ def fetchSeriesArtworkAndNfo(seriesDir, seasonDir, series, season, override = fa
|
|||
*/
|
||||
def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
|
||||
if (outputFile.exists() && !override) {
|
||||
println "Artwork already exists: $outputFile"
|
||||
_log.finest "Artwork already exists: $outputFile"
|
||||
return outputFile
|
||||
}
|
||||
|
||||
|
@ -149,10 +149,10 @@ def fetchMovieArtwork(outputFile, movieInfo, category, override, locale) {
|
|||
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 } }
|
||||
if (selection == null) {
|
||||
println "Artwork not found: $outputFile"
|
||||
_log.finest "Artwork not found: $outputFile"
|
||||
return null
|
||||
}
|
||||
println "Fetching $outputFile => $selection"
|
||||
_log.finest "Fetching $outputFile => $selection"
|
||||
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 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) {
|
||||
println "Artwork not found: $outputFolder"
|
||||
_log.finest "Artwork not found: $outputFolder"
|
||||
return null
|
||||
}
|
||||
selection.eachWithIndex{ s, i ->
|
||||
def outputFile = new File(outputFolder, "$category-${(i+1).pad(2)}.jpg")
|
||||
if (outputFile.exists() && !override) {
|
||||
println "Artwork already exists: $outputFile"
|
||||
_log.finest "Artwork already exists: $outputFile"
|
||||
} else {
|
||||
println "Fetching $outputFile => $s"
|
||||
_log.finest "Fetching $outputFile => $s"
|
||||
s.url.saveAs(outputFile)
|
||||
}
|
||||
}
|
||||
|
@ -177,16 +177,16 @@ def fetchAllMovieArtwork(outputFolder, movieInfo, category, override, locale) {
|
|||
|
||||
def fetchMovieFanart(outputFile, movieInfo, type, diskType, override, locale) {
|
||||
if (outputFile.exists() && !override) {
|
||||
println "Fanart already exists: $outputFile"
|
||||
_log.finest "Fanart already exists: $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) }}
|
||||
if (fanart == null) {
|
||||
println "Fanart not found: $outputFile / $type"
|
||||
_log.finest "Fanart not found: $outputFile / $type"
|
||||
return null
|
||||
}
|
||||
println "Fetching $outputFile => $fanart"
|
||||
_log.finest "Fetching $outputFile => $fanart"
|
||||
return fanart.url.saveAs(outputFile)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue