Skip to content

Commit

Permalink
Merge pull request same31#4 from assafmo/patch-1
Browse files Browse the repository at this point in the history
add hearing impaired indicator to subInfo
  • Loading branch information
same31 authored Apr 2, 2018
2 parents 307076f + c3b8081 commit 3d64ab3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function findSubtitles (body, languages) {
versionRegExp = /Version (.+?),([^]+?)<\/table/g,
versionMatch,
version,
hearingImpaired,
subInfoRegExp = /class="language">([^]+?)<a[^]+?(% )?Completed[^]+?href="([^"]+?)"><strong>(?:most updated|Download)/g,
subInfoMatch,
lang,
Expand All @@ -71,6 +72,7 @@ function findSubtitles (body, languages) {
// ===============================
while ((versionMatch = versionRegExp.exec(body)) !== null) {
version = versionMatch[1].toUpperCase();
hearingImpaired = ~versionMatch[2].indexOf('Hearing Impaired');

while ((subInfoMatch = subInfoRegExp.exec(versionMatch[2])) !== null) {
notCompleted = subInfoMatch[2];
Expand Down Expand Up @@ -100,15 +102,16 @@ function findSubtitles (body, languages) {

team = version.replace(/.?(REPACK|PROPER|[XH].?264|HDTV|480P|720P|1080P|2160P|AMZN|WEB(.DL|.?RIP)?|WR|BRRIP|BDRIP|BLURAY)+.?/g, '')
.trim().toUpperCase() || 'UNKNOWN';

subs.push({
lang: lang,
langId: langId,
distribution: distribution,
team: team,
version: version,
link: link,
referer: referer
lang: lang,
langId: langId,
distribution: distribution,
team: team,
version: version,
link: link,
referer: referer,
hearingImpaired: hearingImpaired
});
}
}
Expand Down

0 comments on commit 3d64ab3

Please sign in to comment.