From c3c21e9dc891d94e2b87d5dbdca41e0708fb9df9 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Wed, 23 Dec 2020 11:28:45 +0100 Subject: [PATCH] [scraper] updates manual functions --- .gitignore | 3 +- scraper/manual/manual.js | 93 +++------------------------------------- 2 files changed, 9 insertions(+), 87 deletions(-) diff --git a/.gitignore b/.gitignore index c285558..7bbf0b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.idea **/node_modules **.env -.now \ No newline at end of file +.now +/scraper/manual/examples.js \ No newline at end of file diff --git a/scraper/manual/manual.js b/scraper/manual/manual.js index f9081ab..f4637c0 100644 --- a/scraper/manual/manual.js +++ b/scraper/manual/manual.js @@ -1,5 +1,6 @@ const Bottleneck = require('bottleneck'); const { parse } = require('parse-torrent-title'); +const Promises = require('../lib/promises'); const { mostCommonValue } = require('../lib/promises'); const repository = require('../lib/repository'); const { getImdbId } = require('../lib/metadata'); @@ -123,96 +124,16 @@ async function openTorrentContents() { .then(() => unopenedTorrents.length === 500 ? openTorrentContents() : Promise.resolve) } -async function findAllFiles() { - /* Test cases */ - /* Anime Season and absolute episodes */ - const torrent = { - infoHash: '6b95e5cfde9aaa71970a14f6bb6b9de19e2cbfa1', - title: '[OMDA] Bleach + Filmes + Ovas (480p-720p x264 AAC-MP3) [rich_jc]', - type: Type.SERIES, - imdbId: 'tt0434665' - }; - /* Season and concat episodes */ - // const torrent = { - // infoHash: '235e8ed73b6cc9679b0842c39e17223c47b51f68', - // title: 'Daria - The Complete Animated Series [2010] DVDRip', - // type: Type.SERIES, - // imdbId: 'tt0118298' - // }; - /* Series Season and absolute episodes */ - // const torrent = { - // infoHash: '16b4560beb05397c0eeb35487a997caf789243ea', - // title: 'Seinfeld - Complete Collection', - // type: Type.SERIES, - // imdbId: 'tt0098904' - // }; - /* Series Season and episodes */ - // const torrent = { - // infoHash: 'd0f120c1bbfb988eb35b648e1c78ca3e5d45ef39', - // title: 'Seinfeld Complete Series-720p WEBrip EN-SUB x264-[MULVAcoded]', - // type: Type.SERIES, - // imdbId: 'tt0098904' - // }; - /* Anime single absolute episode */ - // const torrent = { - // infoHash: 'e81e12880980086c476aa8bfdd22bed9d41b1dfe', - // title: '[Vision] Naruto Shippuuden - 451 (1080p x264 AAC) [rich_jc].mp4', - // size: 467361138, - // type: Type.SERIES, - // imdbId: 'tt0988824' - // }; - /* Date based episode */ - // const torrent = { - // infoHash: '5a8e9e64fa04e3541236f049cb6b0d35e4ca12cc', - // title: 'Jimmy.Fallon.2020.02.14.Steve.Buscemi.WEB.x264-XLF[TGx]', - // size: 618637331, - // type: Type.SERIES, - // imdbId: 'tt3444938' - // }; - /* Not all seasons available so Date based episode */ - // const torrent = { - // infoHash: 'DCD5ACF85F4203FE14428A890528B2EDBD07B092', - // title: 'The Young And The Restless - S43 E10986 - 2016-08-12', - // size: 989777743, - // type: Type.SERIES, - // imdbId: 'tt0069658' - // }; - // const torrent = { - // infoHash: 'C75FBDCD62EB882746A0E58B19BADD60DE14526B', - // title: 'Jimmy.Kimmel.2016.08.03.Hugh.Grant.480p.x264-mSD', - // size: 618637331, - // type: Type.SERIES, - // imdbId: 'tt0320037' - // }; - /* With extras exceeding season episode count */ - // const torrent = { - // infoHash: '2af56a80357b61d839328b986d1165ea8395bbc0', - // title: 'Tim and Eric - Complete', - // type: Type.SERIES, - // imdbId: 'tt0912343' - // }; - /* With two anime seasons counted as one season */ - // const torrent = { - // infoHash: 'ea02b20a87df600c11d2b405e52813de5d431102', - // title: '[zza] No Guns Life - (S01-S02) [1080p.x265][multisubs:eng,fre][Vostfr]', - // type: Type.ANIME, - // kitsuId: 42197 - // }; - /* With two anime seasons in absolute order counted as one season */ - // const torrent = { - // infoHash: '8b894d747451d50a3bd8d8fd962e4d49da6850ec', - // title: '[JacobSwaggedUp] Gate | Gate: Jieitai Kanochi nite, Kaku Tatakaeri | Gate: Thus the JSDF Fought There! - - // Complete (BD 1280x720) [MP4 Batch]', type: Type.ANIME, kitsuId: 10085 }; - - return parseTorrentFiles(torrent) - .then((files) => console.log(files.videos)); -} +// const infoHashes = [ +// ] +// Promises.sequence(infoHashes.map(infoHash => () => reapplyEpisodeDecomposing(infoHash))) +// .then(() => console.log('Finished')); //findAllFiles().then(() => console.log('Finished')); //updateMovieCollections().then(() => console.log('Finished')); -reapplyEpisodeDecomposing('9bfabed62825874d2f2150ffb45c533f48636222', false).then(() => console.log('Finished')); +reapplyEpisodeDecomposing('96cc18f564f058384c18b4966a183d81808ce3fb', true).then(() => console.log('Finished')); //reapplySeriesSeasonsSavedAsMovies().then(() => console.log('Finished')); -//reapplyDecomposingToTorrentsOnRegex('.*Boku no Hero Academia.*').then(() => console.log('Finished')); +//reapplyDecomposingToTorrentsOnRegex('.*Title.*').then(() => console.log('Finished')); //reapplyManualHashes().then(() => console.log('Finished')); // assignSubs().then(() => console.log('Finished')); // openTorrentContents().then(() => console.log('Finished')); \ No newline at end of file