added more custom filename variables

This commit is contained in:
ssttevee 2017-03-29 14:10:06 -07:00
parent 4dc90aeb00
commit 2c2ed2c136
No known key found for this signature in database
GPG Key ID: 04C1D4F3622920D1
2 changed files with 10 additions and 0 deletions

View File

@ -205,7 +205,10 @@ function name(config: IConfig, page: IEpisodePage, series: string, extra: string
.replace(/{EPISODE_NUMBER}/g, episode)
.replace(/{SEASON_NUMBER}/g, volume)
.replace(/{VOLUME_NUMBER}/g, volume)
.replace(/{SEASON_TITLE}/g, page.season)
.replace(/{VOLUME_TITLE}/g, page.season)
.replace(/{SERIES_TITLE}/g, series)
.replace(/{EPISODE_TITLE}/g, page.title)
.replace(/{TAG}/g, tag) + extra;
}
@ -248,6 +251,7 @@ function scrapePage(config: IConfig, address: string, done: (err: Error, page?:
const regexp = /\s*([^\n\r\t\f]+)\n?\s*[^0-9]*([0-9][\-0-9.]*)?,?\n?\s\s*[^0-9]*((PV )?[S0-9][P0-9.]*[a-fA-F]?)/;
const look = $('#showmedia_about_media').text();
const seasonTitle = $('span[itemprop="title"]').text();
let episodeTitle = $('#showmedia_about_name').text().replace(/[“”]/g, '');
const data = regexp.exec(look);
if (!swf || !data)
@ -258,6 +262,8 @@ function scrapePage(config: IConfig, address: string, done: (err: Error, page?:
episode: '0',
id: epId,
series: seasonTitle,
season: seasonTitle,
title: episodeTitle,
swf: swf[1],
volume: '0',
});
@ -268,6 +274,8 @@ function scrapePage(config: IConfig, address: string, done: (err: Error, page?:
episode: data[3],
id: epId,
series: data[1],
season: seasonTitle,
title: episodeTitle,
swf: swf[1],
volume: data[2] || '1',
});

View File

@ -3,5 +3,7 @@ interface IEpisodePage {
episode: string;
series: string;
volume: string;
season: string;
title: string;
swf: string;
}