From 090d8cc9778e4b738afafd36c38d84ed118f26b9 Mon Sep 17 00:00:00 2001 From: same31 Date: Fri, 16 Sep 2016 10:31:08 +0200 Subject: [PATCH] Handle version that only indicates WEB for WEB-DL distribution --- lib/search.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/search.js b/lib/search.js index 3f19964..14517ec 100644 --- a/lib/search.js +++ b/lib/search.js @@ -90,15 +90,15 @@ function findSubtitles (body, languages) { continue; } - distributionMatch = version.match(/HDTV|WEB.DL|WEB.?RIP|WR|BRRIP|BDRIP|BLURAY/i); + distributionMatch = version.match(/HDTV|WEB(.DL|.?RIP)?|WR|BRRIP|BDRIP|BLURAY/i); distribution = distributionMatch ? distributionMatch[0].toUpperCase() - .replace(/WEB.DL|WEB.?RIP|WR/, 'WEB-DL') + .replace(/WEB(.DL|.?RIP)?|WR/, 'WEB-DL') .replace(/BRRIP|BDRIP|BLURAY/, 'BLURAY') : 'UNKNOWN'; - team = version.replace(/.?(REPACK|PROPER|[XH].?264|HDTV|480P|720P|1080P|2160P|WEB.DL|WEB.?RIP|WR|BRRIP|BDRIP|BLURAY)+.?/g, '') + team = version.replace(/.?(REPACK|PROPER|[XH].?264|HDTV|480P|720P|1080P|2160P|WEB(.DL|.?RIP)?|WR|BRRIP|BDRIP|BLURAY)+.?/g, '') .trim().toUpperCase() || 'UNKNOWN'; subs.push({ diff --git a/package.json b/package.json index b70d807..f4aa19b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "addic7ed-api", - "version": "1.3.0", + "version": "1.3.1", "description": "API to search and download subtitles files from addic7ed.com", "main": "index.js", "dependencies": {