Skip to content

Commit

Permalink
detect ara language
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeastLT committed Oct 30, 2023
1 parent ac6ef7e commit 5691af5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ exports.addDefaults = /** @type Parser */ parser => {
parser.addHandler("languages", /\b(swedish|sueco)\b/i, uniqConcat(value("swedish")), { skipFromTitle: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\b(?:NOR|norsk|norsub|nordic)\b/i, uniqConcat(value("norwegian")), { skipIfAlreadyFound: false });
parser.addHandler("languages", /\b(norwegian|noruegu[eê]s|bokm[aå]l|nob|nor(?=[\]_)]?\.\w{2,4}$))\b/i, uniqConcat(value("norwegian")), { skipFromTitle: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\b(?:arabic|[aá]rabe)\b/i, uniqConcat(value("arabic")), { skipFromTitle: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\b(?:arabic|[aá]rabe|ara)\b/i, uniqConcat(value("arabic")), { skipIfFirst: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\barab.*(?:audio|lang(?:uage)?|sub(?:s|titles?)?)\b/i, uniqConcat(value("arabic")), { skipFromTitle: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\bar(?=\.(?:ass|ssa|srt|sub|idx)$)/i, uniqConcat(value("arabic")), { skipFromTitle: true, skipIfAlreadyFound: false });
parser.addHandler("languages", /\b(?:turkish|tur(?:co)?)\b/i, uniqConcat(value("turkish")), { skipFromTitle: true, skipIfAlreadyFound: false });
Expand Down
16 changes: 16 additions & 0 deletions test/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,12 @@ describe("Parsing language", () => {
expect(parse(releaseName)).to.deep.include({ languages: ["arabic"] });
});

it("Subs(ara,fre,ger).srt", () => {
const releaseName = "Subs(ara,fre,ger).srt";

expect(parse(releaseName)).to.deep.include({ languages: ["french", "german", "arabic"] });
});

it("Miami.Bici.2020.1080p.NETFLIX.WEB-DL.DDP5.1.H.264.EN-ROSub-ExtremlymTorrents", () => {
const releaseName = "Miami.Bici.2020.1080p.NETFLIX.WEB-DL.DDP5.1.H.264.EN-ROSub-ExtremlymTorrents";

Expand Down Expand Up @@ -1130,4 +1136,14 @@ describe("Parsing language", () => {
const releaseName = "Dan Browns The Lost Symbol S01E03 1080p WEB H264-GLHF";
expect(parse(releaseName)).to.not.have.property("languages");
});

it("should not detect ara language", () => {
const releaseName = "Ben.Ara.2015.1080p.WEBRip.x265-RARBG.mp4";
expect(parse(releaseName)).to.not.have.property("languages");
});

it("should not detect ara language v2", () => {
const releaseName = "Ara.(A.Break).2008.DVDRip";
expect(parse(releaseName)).to.not.have.property("languages");
});
});

0 comments on commit 5691af5

Please sign in to comment.