Skip to content

Commit

Permalink
chore: fix subtitles matching
Browse files Browse the repository at this point in the history
  • Loading branch information
AXeL-dev committed Mar 6, 2022
1 parent 6804a23 commit d1d51ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/crawlers/vostfr/animecomplet.crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class AnimeCompletCrawler extends LatestEpisodesCrawler {
return num?.length ? +num[1] : 1;
},
subtitles: (text: string) => {
const sub = text.match(/Episode (?:\d+) (\w+)$/i);
const sub = text.match(/Episode (?:\d+) ([A-Za-z]+)$/i);
return sub?.length ? sub[1].toLowerCase() : 'vostfr';
},
date: (text: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/crawlers/vostfr/jetanimes.crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class JetAnimesCrawler extends LatestEpisodesCrawler {
return num?.length ? +num[1] : 1;
},
subtitles: (text: string) => {
const sub = text.match(/HD (\w+)$/i);
const sub = text.match(/HD ([A-Za-z]+)$/i);
return sub?.length ? sub[1].toLowerCase() : 'vostfr';
},
date: (text: string) => {
Expand Down
4 changes: 2 additions & 2 deletions src/app/crawlers/vostfr/vostanimez.crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export class VostAnimezCrawler extends LatestEpisodesCrawler {
this.filters = {
...this.filters,
title: (text: string) => {
return text.replace(/(.*) \((\w+)\)$/i, '$1');
return text.replace(/(.*) \(([A-Za-z]+)\)$/i, '$1');
},
number: (text: string) => {
const num = text.match(/(.*) episode (\d+)/i);
return num?.length ? +num[2] : 1;
},
subtitles: (text: string) => {
const sub = text.match(/(.*) \((\w+)\)$/i);
const sub = text.match(/(.*) \(([A-Za-z]+)\)$/i);
return sub?.length ? sub[2].toLowerCase() : 'vostfr';
},
date: (text: string) => {
Expand Down

0 comments on commit d1d51ba

Please sign in to comment.