diff --git a/Find Unique Titles/dist/find.unique.titles.user.js b/Find Unique Titles/dist/find.unique.titles.user.js index 39bc470..b18a510 100644 --- a/Find Unique Titles/dist/find.unique.titles.user.js +++ b/Find Unique Titles/dist/find.unique.titles.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Find Unique Titles // @description Find unique titles to cross seed -// @version 0.0.2 +// @version 0.0.3 // @author Mea01 // @match https://cinemageddon.net/browse.php* // @match https://karagarga.in/browse.php* @@ -1957,9 +1957,9 @@ class PTP { getSearchRequest() { return _wrapAsyncGenerator(function* () { var requests = []; - var nodes = common__WEBPACK_IMPORTED_MODULE_3__["default"].dom.findFirst("#torrents-movie-view table.torrent_table > tbody", ".cover-movie-list__movie"); + var nodes = common__WEBPACK_IMPORTED_MODULE_3__["default"].dom.findFirst(document, "#torrents-movie-view table.torrent_table > tbody", "table.torrent_table > tbody tr.basic-movie-list__details-row", ".cover-movie-list__movie"); nodes === null || nodes === void 0 ? void 0 : nodes.forEach(element => { - var elements = common__WEBPACK_IMPORTED_MODULE_3__["default"].dom.findFirst(".basic-movie-list__movie__ratings-and-tags", ".cover-movie-list__movie__rating-and-tags"); + var elements = common__WEBPACK_IMPORTED_MODULE_3__["default"].dom.findFirst(element, ".basic-movie-list__movie__ratings-and-tags", ".cover-movie-list__movie__rating-and-tags"); var imdbId = elements ? (0,_utils_utils__WEBPACK_IMPORTED_MODULE_1__.parseImdbIdFromLink)(elements[0]) : null; var request = { torrents: parseTorrents(element), @@ -2927,9 +2927,9 @@ const appendErrorMessage = () => { div.style.color = "white"; addChild(document.body, div); }; -const findFirst = (...selectors) => { +const findFirst = (element, ...selectors) => { for (let selector of selectors) { - let elements = document.querySelectorAll(selector); + let elements = element.querySelectorAll(selector); if (elements.length > 0) { return elements; } diff --git a/Find Unique Titles/package.json b/Find Unique Titles/package.json index ba4905b..440b5f1 100644 --- a/Find Unique Titles/package.json +++ b/Find Unique Titles/package.json @@ -1,7 +1,7 @@ { "name": "find.unique.titles", "description": "Find unique titles to cross seed", - "version": "0.0.3", + "version": "0.0.4", "author": { "name": "Mea01" }, diff --git a/Find Unique Titles/src/trackers/PTP.ts b/Find Unique Titles/src/trackers/PTP.ts index 0b79882..021e7dd 100644 --- a/Find Unique Titles/src/trackers/PTP.ts +++ b/Find Unique Titles/src/trackers/PTP.ts @@ -61,7 +61,7 @@ const parseCategory = (element: HTMLElement): Category => { ".basic-movie-list__torrent-edition__main" )?.textContent; if (!categoryTitle) { - return null + return null; } if (categoryTitle.includes("Stand-up Comedy ")) { return Category.STAND_UP; @@ -88,11 +88,14 @@ export default class PTP implements tracker { async *getSearchRequest(): AsyncGenerator { const requests: Array = []; const nodes = tracker_tools.dom.findFirst( + document, "#torrents-movie-view table.torrent_table > tbody", + "table.torrent_table > tbody tr.basic-movie-list__details-row", ".cover-movie-list__movie" ); nodes?.forEach((element: HTMLElement) => { let elements = tracker_tools.dom.findFirst( + element, ".basic-movie-list__movie__ratings-and-tags", ".cover-movie-list__movie__rating-and-tags" ); diff --git a/common/src/dom.ts b/common/src/dom.ts index b33315d..0a8bee0 100644 --- a/common/src/dom.ts +++ b/common/src/dom.ts @@ -34,9 +34,9 @@ export const appendErrorMessage = () => { addChild(document.body, div); }; -export const findFirst = (...selectors: string[]) => { +export const findFirst = (element: Element, ...selectors: string[]) => { for (let selector of selectors) { - let elements = document.querySelectorAll(selector); + let elements = element.querySelectorAll(selector); if (elements.length > 0) { return elements; }