-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Morea
committed
Jun 25, 2023
1 parent
4b61f23
commit 5aa73b4
Showing
5 changed files
with
127 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { parseImdbIdFromLink, parseSize } from "../utils/utils"; | ||
import { tracker, Request } from "./tracker"; | ||
import tracker_tools from "common"; | ||
|
||
export default class MTeam implements tracker { | ||
canBeUsedAsSource(): boolean { | ||
return true; | ||
} | ||
|
||
canBeUsedAsTarget(): boolean { | ||
return false; | ||
} | ||
|
||
canRun(url: string): boolean { | ||
return url.includes("https://ncore.pro"); | ||
} | ||
|
||
async getSearchRequest(): Promise<Array<Request>> { | ||
const requests: Array<Request> = []; | ||
for (const element of document.querySelectorAll(".box_torrent")) { | ||
|
||
const imdbId = parseImdbIdFromLink(element); | ||
const size = parseSize(element.children[1].children[4].textContent as string); | ||
|
||
const request: Request = { | ||
torrents: [ | ||
{ | ||
size, | ||
tags: [], | ||
dom: element, | ||
}, | ||
], | ||
dom: element, | ||
imdbId, | ||
query: "", | ||
}; | ||
requests.push(request); | ||
} | ||
|
||
return requests; | ||
} | ||
|
||
name(): string { | ||
return "nCore"; | ||
} | ||
|
||
async canUpload(request: Request) { | ||
return false; | ||
} | ||
|
||
insertTrackersSelect(select: HTMLElement): void { | ||
const element = document.querySelector("#keresoresz tr"); | ||
tracker_tools.dom.addChild(element as HTMLElement, select); | ||
} | ||
} |