Skip to content

Commit

Permalink
feat: support huno
Browse files Browse the repository at this point in the history
  • Loading branch information
techmovie committed Dec 18, 2024
1 parent 34bb23e commit 29acebb
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 7 deletions.
2 changes: 2 additions & 0 deletions SUPPORTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
| HDTime |||
| HDU |||
| HH |||
| HUNO |||
| HaresClub |||
| KEEPFRDS |||
| KG |||
Expand Down Expand Up @@ -72,5 +73,6 @@
| TeamHD |||
| UHDBits |||
| ZHUQUE |||
| agsv |||
| fearnopeer |||
| iTS |||
61 changes: 61 additions & 0 deletions src/config/HUNO.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
url: https://hawke.uno
host: hawke.uno
siteType: UNIT3D
icon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAADOklEQVR4nL1U32/TVhT+kpUXeIAW/gd4Ytr+gT1XCBC/JJAm8RYJTaNqrmP73sRxC+w/mJCmTUKa4AUhBLET0rERDbQ9dR1FRRRBW8UJELa2lC52nNj1QddpsoYB2st2pE86Oj76fI6+7x7gf4gEiLp4TxBRQiLufW/IhkplCNhKJGsU1whIVExzaCtJr0b0NrFJyf5EREkU1vfgOu2O6z3izR+Zppms6/ruZ+n0HjLNZH/izbxLJsNeG4bdzMNy52B7q7C8FVjebNJqckzRDmKf71higteZmK0pYqXGxKrD+JzDeL6q68MxcZ+0sL4PRf8J7hLh9sYGii2K8UMYJX4lwrXl2XtfarOReYFe6vmormSprgj6U89vuMYFmT9ZSvN9XbIr1WFMBY9QIULB9VH0QvxEFMP2gmSp1QH7nvafVOkpE53nighW+AStigmqKSJ0GPdfZyepoRmPHpw5Mwzcak/EkxWabdzqEMptH5Zr4cZ6CRXq4Otp+mj0ixCH1TCfEuRzo7OQ1ktVxq2GlvNfqDmqMt6Wk77IGBNAuTOPckCw3Qh2K0DBH+2L9TMdw9lvKXlwLMIRLfrklE6vFHGs97nGxGhdEYGjiKihGtRQs/OA7UWw3BB3iGB5dtz5zfQ2mNJCAI5kKjiRJZwQlJC51PEzc2g6ldomc0fh9pqYJIfxsKaIaJCw4BZjEum9HuHRdxNS15NwGC++GiDsrWy5EYqtEHbzQH/lu3QcY9/1V/5Urqzmjv+9snagLoWRK2tyZWMeKHpGLIolRWkTyp02brol3PyrjDsU4OJvXVEOqeFkilNLzwULjJerab3UUHPtWJS03naN8/RczRnApaVdmAoe9m0jhZGW+XGLbZTL9PFJlRaZ6DzbYptYEMb99ew5eqkZD38/PbarO/uN13theY8Hje13jf1LbOyZe2f1mcj8iv7QzaieyZLE8qaxa4p4vDiW2Tv49G6v7oTdzMH27sP2lmNY3kzSbmoo0HZKpbYvMqHVGJ9xmFiOofD7TiabW9C0nb13/q7jkECZRnB1bWSgtpnLCzM3Pj7ijI+PyBz/OA4fOl9xbfB89Ug+fL7ejn9/YP/7eAMLS3CiKim0CAAAAABJRU5ErkJggg==
asSource: true
asTarget: true
uploadPath: /torrents/create?category_id=1
torrentDownloadLinkSelector: a[href*="/torrents/download/"]
needDoubanInfo: true
seedDomSelector: .torrent__buttons+.panelV2
search:
path: /torrents
replaceKey:
- tt
- ""
params:
name: "{name}"
imdbId: "{imdb}"
sortField: size
name:
selector: input[name="name"][class="form__text"]
description:
selector: "#bbcode-description"
imdb:
selector: "#autoimdb"
tmdb:
selector: "#autotmdb"
mediaInfo:
selector: textarea[name="mediainfo"]
anonymous:
selector: .form__group input[type="checkbox"][name="anon"]
torrent:
selector: input[type="file"][accept=".torrent"]
category:
selector: "#browsecat"
map:
movie: "1"
tv: "2"
tvPack: "2"
videoType:
selector: "#autotype"
map:
uhdbluray: "1"
bluray: "1"
remux: "3"
encode: "12"
web: "4"
hdtv: "6"
dvd: "1"
dvdrip: "12"
other: ""
resolution:
selector: "#autores"
map:
4320p: "11"
2160p: "1"
1080p: "2"
1080i: "3"
720p: "5"
576p: "6"
480p: "8"
4 changes: 2 additions & 2 deletions src/source/unit3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default async () => {
.siblings('.table-responsive').find('.panel-body').clone();
descriptionDom.find('#collection_waypoint').remove();
let mediaInfoOrBDInfo = $('.decoda-code code').text();
if (CURRENT_SITE_NAME.match(/Blutopia|Aither|fearnopeer/i)) {
if (CURRENT_SITE_NAME.match(/Blutopia|Aither|fearnopeer|HUNO/i)) {
const title = $('.meta__title').text().trim();
movieName = title.replace(/\(.+\)/g, '');
IMDBYear = title.match(/\((\d{4})\)/)?.[1] ?? '';
Expand Down Expand Up @@ -116,7 +116,7 @@ const getBasicInfo = () => {
Resolution: 'Resolution',
resolution: 'Resolution',
};
if (!CURRENT_SITE_NAME.match(/Blutopia|Aither|fearnopeer/i)) {
if (!CURRENT_SITE_NAME.match(/Blutopia|Aither|fearnopeer|HUNO/i)) {
const lineSelector = $('#meta-info+.meta-general>.panel:has(".table-responsive"):first table tr');
lineSelector.each((index, element) => {
const key = $(element).find('td:first').text().replace(/\s|\n/g, '');
Expand Down
10 changes: 5 additions & 5 deletions src/target/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ export default class ExportHelper {

if (CURRENT_SITE_NAME.match(/HDRoute|HDSpace/)) {
$(imdbSelector).val(imdbId?.replace('tt', '') ?? '');
} else if (CURRENT_SITE_NAME.match(/Blutopia|fearnopeer|HDPOST|ACM|Aither|Concertos|MDU|LST/)) {
} else if (CURRENT_SITE_NAME.match(/Blutopia|fearnopeer|HDPOST|ACM|Aither|Concertos|MDU|LST|HUNO/)) {
let tmdbId = '';
const fillIMDBId = this.currentSiteInfo.siteType === 'UNIT3D' ? imdbId.replace('tt', '') : imdbId;
$(imdbSelector).val(fillIMDBId);
getTMDBIdByIMDBId(imdbId).then(data => {
tmdbId = data.id;
$(this.currentSiteInfo.tmdb.selector).val(tmdbId);
});
if (CURRENT_SITE_NAME.match(/Blutopia|fearnopeer|Aither|MDU|LST/)) {
if (CURRENT_SITE_NAME.match(/Blutopia|fearnopeer|Aither|MDU|LST|HUNO/)) {
$('#torrent').on('change', () => {
$(imdbSelector).val(fillIMDBId);
$(this.currentSiteInfo.tmdb.selector).val(tmdbId);
Expand Down Expand Up @@ -179,7 +179,7 @@ export default class ExportHelper {
}

if (this.currentSiteInfo.mediaInfo) {
if (CURRENT_SITE_NAME.match(/^(Blutopia|fearnopeer|Aither|MDU)/)) {
if (CURRENT_SITE_NAME.match(/^(Blutopia|fearnopeer|Aither|MDU|HUNO)/)) {
const selector = isBluray ? 'textarea[name="bdinfo"]' : this.currentSiteInfo.mediaInfo.selector;
$(selector).val(mediaInfos[0]);
description = description.replace(mediaInfos[0].trim(), '');
Expand Down Expand Up @@ -222,7 +222,7 @@ export default class ExportHelper {
}
}
// Blutopia可以通过设置为显示缩略图
if (CURRENT_SITE_NAME.match(/Blutopia|fearnopeer|Aither|MDU/)) {
if (CURRENT_SITE_NAME.match(/Blutopia|fearnopeer|Aither|MDU|HUNO/)) {
if (this.info.sourceSite === 'PTP') {
description = buildPTPDescription(this.info);
}
Expand All @@ -242,7 +242,7 @@ export default class ExportHelper {
}
}

if (CURRENT_SITE_NAME.match(/Blutopia|fearnopeer|Aither/)) {
if (CURRENT_SITE_NAME.match(/Blutopia|fearnopeer|Aither|HUNO/)) {
description = description.replace(/\[align(=(.+?))\]((.|\n)+?)\[\/align\]/g, '[$2]$3[/$2]');
description = description.replace(/\[(\/)?hide(?:=(.+?))?\]/g, (match, p1, p2) => {
const slash = p1 || '';
Expand Down
8 changes: 8 additions & 0 deletions src/target/site-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ export const SITE_OPERATIONS = {
return info;
},
},
HUNO: {
titleHandler: (info:TorrentInfo.TargetTorrentInfo) => {
const isWebSource = !!info.source.match(/web/gi);
const title = fixTorrentTitle(info.title, isWebSource);
info.title = title;
return info;
},
},
KEEPFRDS: {
handleDescription: (info:TorrentInfo.TargetTorrentInfo) => {
let { description, screenshots } = info;
Expand Down

0 comments on commit 29acebb

Please # to comment.