// ==UserScript==
// @name EasyUpload PT一键转种
// @namespace https://github.com/techmovie/easy-upload
// @version 2.2.5
// @description easy uploading torrents to other trackers
// @author birdplane
// @require https://cdn.staticfile.org/jquery/1.7.1/jquery.min.js
// @match https://passthepopcorn.me/torrents.php?id=*
// @match https://broadcasthe.net/torrents.php?id=*
// @match https://uhdbits.org/torrents.php?id=*
// @match http://*/details.php?id=*
// @match https://*/details.php?id=*
// @match https://totheglory.im/t/*
// @match https://beyond-hd.me/torrents/*
// @match https://lemonhd.org/upload_*
// @match https://lemonhd.org/details*
// @match https://blutopia.xyz/torrents/*
// @match https://blutopia.xyz/torrents?*
// @match https://blutopia.xyz/upload/*
// @match https://pt.hdpost.top/torrents?*
// @match https://pt.hdpost.top/torrents/*
// @match https://asiancinema.me/torrents/*
// @match https://asiancinema.me/torrents?*
// @match https://aither.cc/torrents/*
// @match https://aither.cc/torrents?*
// @match https://ptpimg.me/*
// @match https://*/upload*
// @match http://*/upload*
// @match http://www.hd.ai/Torrents.upload
// @match http://www.hd.ai/Torrents.index?*
// @match https://broadcity.in/browse.php?imdb=*
// @match https://privatehd.to/torrent/*
// @match https://avistaz.to/torrent/*
// @match https://piratethenet.org/browse.php?*
// @match https://teamhd.org/details/id*
// @run-at document-end
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_openInTab
// @grant GM_xmlhttpRequest
// @license MIT
// @downloadURL none
// ==/UserScript==
(() => {
var __assign = Object.assign;
// src/config.json
var PT_SITE = {
"1PTBA": {
url: "https://1ptba.com",
host: "1ptba.com",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
x264: "1",
hevc: "10",
x265: "10",
h265: "10",
mpeg2: "4",
mpeg4: "1",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "18",
dd: "18",
"dd+": "18",
flac: "1",
dts: "3",
truehd: "20",
lpcm: "21",
dtshdma: "19",
atmos: "19",
dtsx: "3",
ape: "2",
wav: "22",
mp3: "4",
m4a: "5",
other: "7"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "10",
bluray: "13",
remux: "3",
encode: "7",
web: "11",
hdtv: "5",
dvd: "2",
dvdrip: "7",
other: "12",
cd: "8"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"4320p": "11",
"2160p": "10",
"1080p": "2",
"1080i": "2",
"720p": "4",
"576p": "5",
"480p": "5"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
"1ptba": "1",
chd: "2",
mysilu: "3",
wiki: "4",
other: "5"
}
}
},
"3Wmg": {
url: "https://www.3wmg.com",
host: "3wmg.com",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="pt_gen[douban][link]"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
tags: {
chinese_audio: 'input[name="tags[]"][value="16"]',
diy: 'input[name="tags[]"][value="8"]',
hdr: 'input[name="tags[]"][value="64"]',
chinese_subtitle: 'input[name="tags[]"][value="32"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "403",
tvPack: "402",
documentary: "404",
concert: "406",
sport: "410",
cartoon: "405",
variety: "403"
}
},
source: {
selector: 'select[name="source_sel"]',
map: {
uhdbluray: "1",
bluray: "1",
hdtv: "4",
dvd: "3",
web: "6",
vhs: "6",
hddvd: "2"
}
}
},
"52pt": {
url: "https://52pt.site",
host: "52pt.site",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "13",
x264: "11",
hevc: "1",
x265: "12",
h265: "1",
mpeg2: "4",
mpeg4: "13",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "13",
ac3: "6",
dd: "6",
"dd+": "6",
flac: "1",
dts: "15",
truehd: "12",
lpcm: "14",
dtshdma: "4",
atmos: "10",
dtsx: "3",
ape: "2",
wav: "11",
other: "7"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "1",
bluray: "11",
remux: "4",
encode: "7",
web: "10",
hdtv: "3",
dvd: "6",
dvdrip: "7",
other: "9",
cd: "8"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"4320p": "7",
"2160p": "5",
"1080p": "1",
"1080i": "2",
"720p": "3",
"576p": "6",
"480p": "6"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
beyondhd: "1",
hdsky: "2",
ttg: "3",
mteam: "8",
coaster: "4",
chdbits: "9",
ourbits: "10",
hdhome: "11",
cmct: "12",
hdchina: "14",
pthome: "15",
other: "5"
}
}
},
ACM: {
url: "https://asiancinema.me",
host: "asiancinema.me",
siteType: "UNIT3D",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload/1",
needDoubanInfo: true,
seedDomSelector: "#vue+.panel table>tbody>tr:last",
search: {
path: "/torrents",
params: {
name: "{name}",
imdb: "{imdb}"
}
},
name: {
selector: "#title"
},
description: {
selector: "#upload-form-description"
},
imdb: {
selector: "#autoimdb"
},
tmdb: {
selector: "#autotmdb"
},
mediaInfo: {
selector: 'textarea[name="mediainfo"]'
},
anonymous: {
selector: '.radio-inline:first input[name="anonymous"]'
},
videoType: {
selector: "#autocat",
map: {
movie: "1",
tv: "2",
tvPack: "2"
}
},
category: {
selector: "#autotype",
map: {
BD100: "1",
BD66: "2",
UHD50: "3",
BD50: "4",
BD25: "5",
remux: [
"12",
"7"
],
encode: [
"8",
"10",
"11",
"13"
],
web: "9",
hdtv: "17",
dvd: [
"14",
"16"
],
dvdrip: "13",
other: ""
}
},
resolution: {
selector: "#autores",
map: {
"2160p": [
"1",
"1",
"2",
"3",
"12",
"8"
],
"1080p": [
"2",
"4",
"5",
"7",
"10"
],
"1080i": [
"2",
"4",
"5",
"7",
"10"
],
"720p": [
"3",
"11"
],
"576p": [
"4",
"13"
],
"480p": [
"5",
"14",
"16",
"13"
],
other: ""
}
}
},
Aither: {
url: "https://aither.cc",
host: "aither.cc",
siteType: "UNIT3D",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload/1",
needDoubanInfo: true,
seedDomSelector: "#vue+.panel table tr:last",
search: {
path: "/torrents",
params: {
name: "{name}",
imdb: "{imdb}"
}
},
name: {
selector: "#title"
},
description: {
selector: "#upload-form-description"
},
imdb: {
selector: "#autoimdb"
},
tmdb: {
selector: "#autotmdb"
},
mediaInfo: {
selector: 'textarea[name="mediainfo"]'
},
anonymous: {
selector: '.radio-inline:first input[name="anonymous"]'
},
category: {
selector: "#browsecat",
map: {
movie: "1",
tv: "2",
tvPack: "2",
documentary: "1",
concert: "3",
sport: "9",
cartoon: "405",
app: "10",
ebook: "11",
magazine: "11",
audioBook: "14"
}
},
videoType: {
selector: "#autotype",
map: {
uhdbluray: "1",
bluray: "1",
remux: "2",
encode: "3",
web: "4",
hdtv: "6",
dvd: "1",
dvdrip: "3",
other: "7"
}
},
resolution: {
selector: "#autores",
map: {
"4320p": "1",
"2160p": "3",
"1080p": "3",
"1080i": "4",
"720p": "5",
"576p": "6",
"480p": "8"
}
}
},
AvistaZ: {
url: "https://avistaz.to",
host: "avistaz.to",
siteType: "AvistaZ",
icon: '',
asSource: true,
asTarget: false,
uploadPath: "/upload.php",
seedDomSelector: "#content-area .block:last table:first>tbody>tr:nth-child(3)",
needDoubanInfo: true,
search: {
path: "/torrents",
params: {
search: "{imdb}",
in: "1",
order: "size",
sort: "desc"
}
}
},
BTN: {
url: "https://broadcasthe.net",
host: "broadcasthe.net",
siteType: "gazelle",
icon: '',
asSource: true,
asTarget: false,
needDoubanInfo: true,
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
params: {
action: "advanced",
imdb: "{imdb}",
artistname: "{name}"
}
}
},
BTSCHOOL: {
url: "https://pt.btschool.club",
host: "btschool.club",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
poster: 'input[name="picture"]',
imdb: {
selector: 'input[name="imdbid"]'
},
douban: {
selector: 'input[name="doubanid"]'
},
tags: {
chinese_audio: 'input[type="checkbox"][name="span[]"][value="5"]',
chinese_subtitle: 'input[type="checkbox"][name="span[]"][value="6"]'
},
category: {
selector: "#browsecat",
map: {
movie: "405",
tv: "406",
tvPack: "406",
documentary: "408",
concert: "409",
sport: "410",
cartoon: "407",
variety: "412"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
x264: "1",
hevc: "10",
x265: "10",
h265: "10",
mpeg2: "4",
mpeg4: "1",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "10",
dd: "10",
"dd+": "10",
flac: "1",
dts: "3",
truehd: "11",
lpcm: "5",
dtshdma: "3",
atmos: "3",
dtsx: "3"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "12",
bluray: "1",
remux: "3",
encode: "7",
web: "10",
hdtv: "5",
dvd: "6",
dvdrip: "6",
other: "11"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "5",
"1080p": "1",
"1080i": "1",
"720p": "3",
"576p": "4",
"480p": "4"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
btschool: "1",
zone: "13",
btshd: "2",
btstv: "3",
btspad: "4",
wiki: "5",
hdchina: "6",
hdbint: "7",
mteam: "9",
cmct: "10",
ourbits: "11",
other: "12"
}
}
},
Bdc: {
url: "https://broadcity.in",
host: "broadcity.in",
siteType: "Bdc",
icon: '',
asSource: false,
asTarget: false,
uploadPath: "/upload.php",
search: {
path: "/browse.php",
imdbOptionKey: "t_genre",
nameOptionKey: "t_name",
params: {
imdb: "{imdb}",
search_area: "{optionKey}"
}
}
},
BeiTai: {
url: "https://www.beitai.pt",
host: "beitai.pt",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: false,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
}
},
BeyondHD: {
url: "https://beyond-hd.me",
host: "beyond-hd.me",
siteType: "F3NIX",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: ".table-details tr:last",
needDoubanInfo: true,
uploadPath: "/upload",
search: {
path: "/torrents/all",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
imdb: "{imdb}",
search: "{name}",
sorting: "size",
direction: "desc",
doSearch: "Search"
}
},
sourceInfo: {
editionTags: {
"10-bit": "10_bit",
"2-Disc Set": "2_disc_set",
"2D/3D Edition": "2d_3d_edition",
"2in1": "2_in_1",
"3D": "3d",
"3D Anaglyph": "3d_anaglyph",
"3D Full SBS": "3d_full_sbs",
"3D Half OU": "3d_half_ou",
"3D Half SBS": "3d_half_sbs",
"4K Remaster": "4k_remaster",
"4K Restoration": "4k_restoration",
"Digital Extras": "extras",
"Director's Cut": "director_s_cut",
"Dolby Atmos": "dolby_atmos",
"Dolby Vision": "dolby_vision",
"Dual Audio": "dual_audio",
"English Dub": "english_dub",
"Extended Cut": "extended_edition",
"Extended Edition": "extended_edition",
Extras: "extras",
HDR10: "hdr10",
"HDR10+": "hdr10_plus",
"Masters of Cinema": "masters_of_cinema",
Scene: "scene",
"The Criterion Collection": "the_criterion_collection",
"Theatrical Cut": "theatrical_cut",
Trumpable: null,
"Two-Disc Set": "two_disc_set",
Remux: "remux",
Rifftrax: "rifftrax",
Uncut: "uncut",
Unrated: "unrated",
"Warner Archive Collection": "warner_archive_collection",
Commentary: "with_commentary"
}
},
name: {
selector: "#title"
},
description: {
selector: "#upload-form-description"
},
imdb: {
selector: "#imdbauto"
},
tmdb: {
selector: "#tmdbauto"
},
mediaInfo: {
selector: "#mediainfo"
},
anonymous: {
selector: 'input[name="anonymous"]'
},
videoType: {
selector: "#category_id",
map: {
movie: "1",
tv: "2",
tvPack: "2"
}
},
category: {
selector: "#autotype",
map: {
BD100: "UHD 100",
BD66: "UHD 66",
UHD50: "UHD 50",
BD50: "BD 50",
BD25: "BD 25",
remux: [
"UHD Remux",
"BD Remux",
"DVD Remux"
],
encode: [
"2160p",
"1080p",
"720p",
"576p",
"540p",
"480p"
],
web: [
"2160p",
"1080p",
"720p",
"576p",
"540p",
"480p"
],
hdtv: [
"2160p",
"1080p",
"1080i",
"720p"
],
dvd: [
"DVD 9",
"DVD 5",
"DVD Remux"
],
dvdrip: [
"480p"
],
other: ""
}
},
source: {
selector: "#autosource",
map: {
uhdbluray: [
"Blu-ray"
],
bluray: [
"Blu-ray",
"BD 50",
"BD 25",
"BD Remux",
"UHD 100",
"UHD 66",
"UHD 50",
"UHD Remux",
"2160p",
"1080p",
"720p",
"576p",
"540p",
"480p"
],
hdtv: [
"HDTV",
"2160p",
"1080p",
"1080i",
"720p"
],
dvd: [
"DVD",
"DVD 9",
"DVD 5",
"DVD Remux",
"480p"
],
web: [
"WEB",
"2160p",
"1080p",
"720p",
"576p",
"540p",
"480p"
],
hddvd: "HD-DVD"
}
},
resolution: {
map: {
"2160p": [
"UHD 100",
"UHD 66",
"UHD 50",
"UHD Remux",
"2160p"
],
"1080p": [
"BD 50",
"BD 25",
"BD Remux",
"1080p"
],
"1080i": [
"BD 50",
"BD 25",
"BD Remux",
"1080i"
],
"720p": [
"720p"
],
"576p": [
"576p"
],
"540p": [
"540p"
],
"480p": [
"DVD 9",
"DVD 5",
"DVD Remux",
"480p"
],
other: [
"Other"
]
}
}
},
Bib: {
url: " https://bibliotik.me",
host: "bibliotik.me",
siteType: "Bib",
icon: '',
asSource: false,
asTarget: true,
uploadPath: "/upload",
name: {
selector: "#TitleField"
},
description: {
selector: "#DescriptionField"
},
anonymous: {
selector: "#AnonymousField"
},
image: {
selector: "#ImageField"
},
format: {
selector: "#FormatField",
map: {
epub: "15",
mobi: "16",
pdf: "2",
azw3: "21"
}
}
},
Blutopia: {
url: "https://blutopia.xyz",
host: "blutopia.xyz",
siteType: "UNIT3D",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload/1",
needDoubanInfo: true,
seedDomSelector: "#meta-info+.meta-general>.panel:first table tr:last",
search: {
path: "/torrents",
replaceKey: [
"tt",
""
],
params: {
name: "{name}",
imdbId: "{imdb}",
sortField: "size"
}
},
name: {
selector: "#title"
},
description: {
selector: "#upload-form-description"
},
imdb: {
selector: "#autoimdb"
},
tmdb: {
selector: "#autotmdb"
},
mediaInfo: {
selector: 'textarea[name="mediainfo"]'
},
anonymous: {
selector: '.radio-inline:first input[name="anonymous"]'
},
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"
}
}
},
CHDBits: {
url: "https://chdbits.co",
host: "chdbits.co",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(6)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: 'textarea[name="descr"]'
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
tags: {
chinese_audio: 'input[name="cnlang"]',
chinese_subtitle: 'input[name="cnsub"]',
diy: 'input[name="diy"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "403",
tvPack: "402",
documentary: "404",
cartoon: "405",
sport: "407",
concert: "406"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "5",
h265: "5",
x264: "1",
x265: "5",
mpeg2: "4",
mpeg4: "6",
vc1: "2",
xvid: "6"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "7",
dd: "4",
"dd+": "7",
flac: "1",
dts: "3",
truehd: "11",
lpcm: "13",
dtshdma: "10",
atmos: "10",
dtsx: "3"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: [
"19"
],
bluray: [
"1"
],
remux: [
"3"
],
encode: [
"4"
],
web: [
"18"
],
hdtv: [
"6"
]
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": [
"6"
],
"1080p": [
"1"
],
"1080i": [
"2"
],
"720p": [
"3"
],
"480p": [
"5"
]
}
},
area: {
selector: 'select[name="processing_sel"]',
map: {
CN: "8",
US: "3",
EU: "7",
HK: "5",
TW: "9",
JP: "4",
KR: "6",
OT: "0"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
chdbits: "14",
sgnb: "13",
remux: "1",
chdtv: "2",
chdpad: "15",
chdweb: "12",
chdhktv: "11",
stbox: "10",
onehd: "8",
blucook: "16",
hqc: "17",
gbt: "18",
kan: "19"
}
}
},
DiscFan: {
url: "https://discfan.net",
host: "discfan.net",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: 'textarea[name="descr"]'
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="douban_url"]'
},
category: {
selector: "#browsecat1",
map: {
tv: "411",
tvPack: "411",
documentary: "413",
cartoon: "419",
sport: "417",
concert: "414",
variety: "416"
}
},
videoType: {
selector: 'select[name="source_sel"]',
map: {
uhdbluray: "2",
bluray: "3",
remux: "0",
encode: "0",
web: "9",
hdtv: "1",
dvd: "4",
hddvd: "4",
dvdrip: "10",
other: "0"
}
},
area: {
selector: "#browsecat",
map: {
CN: "401",
US: "410",
EU: "410",
HK: "404",
TW: "405",
JP: "403",
KR: "406"
}
}
},
FL: {
url: "https://filelist.io",
host: "filelist.io",
siteType: "FL",
icon: '',
asSource: false,
asTarget: false,
uploadPath: "/upload.php",
search: {
path: "/browse.php",
imdbOptionKey: "3",
nameOptionKey: "0",
params: {
search: "{imdb}",
searchin: "{optionKey}",
sort: "3"
}
}
},
GPW: {
url: "https://greatposterwall.com",
host: "greatposterwall.com",
siteType: "gazelle",
icon: '',
asSource: false,
asTarget: true,
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
params: {
searchstr: "{imdb}",
order_by: "size",
order_way: "desc",
group_results: 1,
action: "basic",
searchsubmit: 1
}
},
needDoubanInfo: true,
targetInfo: {
editionTags: {
"10_bit": "10_bit",
"2_disc_set": "2_disc_set",
"2d_3d_edition": "2d_3d_edition",
"2_in_1": "2_in_1",
"3d": "3d",
"3d_anaglyph": "3d_anaglyph",
"3d_full_sbs": "3d_full_sbs",
"3d_half_ou": "3d_half_ou",
"3d_half_sbs": "3d_half_sbs",
"4k_remaster": "4k_remaster",
"4k_restoration": "4k_restoration",
director_s_cut: "director_s_cut",
dolby_atmos: "dolby_atmos",
dolby_vision: "dolby_vision",
dual_audio: "dual_audio",
english_dub: "english_dub",
extended_edition: "extended_edition",
extras: "extras",
hdr10: "hdr10",
hdr10_plus: "hdr10plus",
masters_of_cinema: "masters_of_cinema",
scene: null,
the_criterion_collection: "the_criterion_collection",
theatrical_cut: "theatrical_cut",
two_disc_set: "2_disc_set",
remux: null,
rifftrax: "rifftrax",
uncut: "uncut",
unrated: "unrated",
warner_archive_collection: "warner_archive_collection",
with_commentary: "with_commentary"
}
},
description: {
selector: "#release_desc"
},
imdb: {
selector: "#imdb"
},
mediaInfo: {
selector: 'textarea[name="mediainfo[]"]'
},
category: {
selector: "#releasetype",
map: {
movie: "1",
tv: "3",
tvPack: "3",
concert: "5"
}
},
source: {
selector: "#source",
map: {
uhdbluray: "Blu-ray",
bluray: "Blu-ray",
web: "WEB",
hdtv: "HDTV",
hddvd: "HD-DVD",
dvd: "DVD",
other: "Other"
}
},
videoCodec: {
selector: "#codec",
map: {
h264: "H.264",
hevc: "H.265",
x264: "x264",
x265: "x265",
h265: "H.265",
mpeg2: "Other",
mpeg4: "H.264",
vc1: "Other",
xvid: "xvid"
}
},
resolution: {
selector: "#resolution",
map: {
NTSC: "NTSC",
PAL: "PAL",
"2160p": "2160p",
"1080p": "1080p",
"1080i": "1080i",
"720p": "720p",
"576p": "576p",
"480p": "480p"
}
},
format: {
selector: "#container",
map: {
mkv: "MKV",
mp4: "MP4",
avi: "AVI",
ts: "TS",
wmv: "WMV",
vob: "VOB IFO",
iso: "ISO",
mpg: "MPG",
m2ts: "m2ts"
}
},
videoType: {
selector: "#processing",
map: {
encode: "Encode",
remux: "Remux",
DIY: "DIY",
bluray: "Untouched",
uhdbluray: "Untouched",
dvd: "Untouched",
dvdrip: "Encode"
}
}
},
HD4FANS: {
url: "https://pt.hd4fans.org",
host: "hd4fans.org",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "403",
tvPack: "402",
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
variety: "405"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "1",
bluray: "1",
hddvd: "2",
remux: "3",
encode: "7",
web: "7",
hdtv: "5",
dvd: "6",
dvdrip: "6",
other: ""
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "10",
x264: "1",
x265: "10",
h265: "10",
mpeg2: "4",
mpeg4: "5",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "5",
"1080p": "1",
"1080i": "2",
"720p": "3",
"576p": "4",
"480p": "4"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
chd: "2",
mysilu: "3",
wiki: "4",
other: "5",
cmct: "6",
r2ts: "7",
kbits: "8"
}
}
},
HDAI: {
url: "http://www.hd.ai",
host: "hd.ai",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/Torrents.upload",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
search: {
path: "/Torrents.index",
imdbOptionKey: "9",
nameOptionKey: "1",
params: {
name: "{name}",
search_area: "{optionKey}",
imdb: "{imdb}"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
poster: 'input[name="poster"]',
imdb: {
selector: 'input[name="url"][type="text"]'
},
mediaInfo: {
selector: 'textarea[name="nfo"]'
},
screenshots: {
selector: 'textarea[name="screenshot"]'
},
tags: {
chinese_audio: 'input[type="checkbox"][name="tag[cn]"]',
chinese_subtitle: 'input[type="checkbox"][name="tag[zz]"]'
},
category: {
selector: 'select[name="type"]',
map: {
movie: "1",
tv: "2",
tvPack: "2",
documentary: "4",
concert: "6",
sport: "7",
cartoon: "5",
variety: "3"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "2",
hevc: "1",
x264: "2",
x265: "1",
h265: "1",
mpeg2: "5",
mpeg4: "2",
vc1: "3",
xvid: "4",
dvd: "5"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "10",
ac3: "11",
dd: "11",
"dd+": "11",
flac: "7",
dts: "5",
truehd: "4",
lpcm: "6",
dtshdma: "2",
atmos: "3",
dtsx: "1"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "1",
bluray: "2",
remux: "3",
encode: "5",
web: "4",
hdtv: "6",
dvd: "7",
dvdrip: "10",
other: "0"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"4320p": "1",
"2160p": "2",
"1080p": "3",
"1080i": "4",
"720p": "5",
"576p": "6",
"480p": "6"
}
},
area: {
selector: 'select[name="source_sel"]',
map: {
CN: "1",
US: "2",
EU: "2",
HK: "3",
TW: "3",
JP: "4",
KR: "5",
OT: "6"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
other: "1",
ao: "20",
beitai: "18",
beyondhd: "19",
beast: "23",
chd: "2",
chdbits: "3",
cmct: "4",
frds: "5",
fltth: "17",
hdai: "6",
hdchina: "7",
hdhome: "8",
hdsky: "9",
lemonhd: "28",
leaguehd: "29",
mteam: "10",
nypt: "24",
ngb: "26",
ourtv: "11",
ourbits: "12",
pter: "13",
pthome: "14",
putao: "22",
strife: "21",
tjupt: "15",
ttg: "16",
tlf: "30",
u2: "31",
wiki: "25"
}
}
},
HDArea: {
url: "https://www.hdarea.co",
host: "hdarea.co",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="dburl"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: [
"300",
"401",
"415",
"416",
"410",
"411",
"414",
"412",
"413",
"417"
],
tv: [
"402",
"403"
],
tvPack: "402",
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "7",
x264: "7",
hevc: "6",
x265: "6",
h265: "6",
mpeg2: "4",
mpeg4: "1",
vc1: "2",
xvid: "0",
dvd: "0"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "11",
dd: "5",
"dd+": "4",
flac: "1",
dts: "3",
truehd: "7",
lpcm: "8",
dtshdma: "4",
atmos: "10",
dtsx: "0"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: [
"1",
"300"
],
bluray: [
"1",
"401"
],
remux: [
"3",
"415"
],
encode: "7",
web: [
"9",
"412"
],
hdtv: [
"5",
"413"
],
dvd: [
"2",
"414"
],
dvdrip: "6",
other: "0"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "5",
"1080p": [
"1",
"410"
],
"1080i": "2",
"720p": [
"3",
"411"
],
"576p": "4",
"480p": "4"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
epic: "1",
hdarea: "2",
hdwing: "3",
wiki: "4",
ttg: "5",
other: "6",
mteam: "7",
hdapad: "8",
chd: "9",
hdaccess: "10",
hdatv: "11",
cxcy: "12",
cmct: "13"
}
}
},
HDAtmos: {
url: "https://hdatmos.club",
host: "hdatmos.club",
siteType: "NexusPHP",
icon: '',
asSource: false,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: 'textarea[name="descr"]'
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
cartoon: "405",
sport: "407",
concert: "406"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "10",
h265: "10",
x264: "1",
x265: "10",
mpeg2: "4",
mpeg4: "1",
vc1: "2",
xvid: "3"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "20",
ac3: "22",
dd: "23",
"dd+": "23",
flac: "17",
dts: "14",
truehd: "13",
lpcm: "15",
dtshdma: "10",
atmos: "11",
dtsx: "12"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "1",
bluray: "1",
remux: "3",
encode: "7",
web: "10",
hdtv: "5",
dvd: "6",
hddvd: "2",
dvdrip: "13",
other: "13"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"4320p": "15",
"2160p": "10",
"1080p": "11",
"1080i": "12",
"720p": "13",
"576p": "14",
"480p": "14"
}
},
area: {
selector: 'select[name="processing_sel"]',
map: {
CN: "3",
US: "4",
EU: "8",
HK: "5",
TW: "3",
JP: "5",
KR: "6",
OT: "9"
}
},
source: {
selector: 'select[name="source_sel"]',
map: {
uhdbluray: "6",
bluray: "6",
hdtv: "3",
dvd: "8",
web: "2",
vhs: "12",
hddvd: "7"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
other: "22"
}
}
},
HDBits: {
url: "https://hdbits.org",
host: "hdbits.org",
siteType: "HDB",
icon: '',
asSource: true,
asTarget: true,
needDoubanInfo: true,
uploadPath: "/upload.php",
seedDomSelector: "#details >tbody >tr:contains(Last seeded)",
search: {
path: "/browse.php",
params: {
sort: "size",
d: "DESC",
search: "{imdb}"
}
},
name: {
selector: "#name"
},
description: {
selector: "#descr"
},
imdb: {
selector: "#imdb"
},
mediaInfo: {
selector: 'textarea[name="techinfo"]'
},
category: {
selector: "#type_category",
map: {
movie: "1",
tv: "2",
tvPack: "2",
documentary: "3",
concert: "4",
sport: "5",
cartoon: "1"
}
},
videoCodec: {
selector: "#type_codec",
map: {
h264: "1",
h265: "5",
hevc: "5",
x264: "1",
x265: "5",
mpeg2: "2",
vc1: "3",
xvid: "4",
bluray: "1",
uhdbluray: "5",
vp9: "6"
}
},
videoType: {
selector: "#type_medium",
map: {
uhdbluray: "1",
bluray: "1",
remux: "5",
encode: "3",
web: "6",
hdtv: "4"
}
}
},
HDChina: {
url: "https://hdchina.org",
host: "hdchina.org",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: ".table_details>tbody>tr:nth-child(1)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
poster: "#cover",
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="douban_id"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: [
"20",
"17",
"16",
"9",
"410",
"27"
],
tv: [
"13",
"25",
"26",
"24",
"27"
],
tvPack: [
"20",
"21",
"22",
"23",
"27"
],
documentary: [
"20",
"5",
"27"
],
concert: "402",
sport: "15",
cartoon: "14",
variety: "401"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "10",
x264: "6",
x265: "10",
h265: "10",
mpeg2: "4",
mpeg4: [
"1",
"27"
],
vc1: "2",
xvid: "3",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "8",
dd: "8",
"dd+": "8",
dts: "3",
truehd: "13",
lpcm: "11",
dtshdma: "12",
atmos: "15",
dtsx: "14",
flac: "1"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: [
"11",
"20",
"410"
],
bluray: [
"11",
"20"
],
remux: "6",
encode: "5",
web: "21",
hdtv: "13",
dvd: "14",
dvdrip: "4",
other: "15"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": [
"17",
"13",
"25",
"26",
"24",
"21",
"22",
"23",
"410"
],
"1080p": [
"11",
"17",
"13",
"25",
"26",
"24",
"21",
"22",
"23"
],
"1080i": [
"12",
"16",
"13",
"25",
"26",
"24",
"21",
"22",
"23"
],
"720p": [
"13",
"9",
"13",
"25",
"26",
"24",
"21",
"22",
"23"
],
"576p": "15",
"480p": "15"
}
},
area: {
map: {
CN: [
"25",
"22"
],
US: [
"13",
"21"
],
EU: [
"13",
"21"
],
HK: [
"25",
"22"
],
TW: [
"25",
"22"
],
JP: [
"24",
"23"
],
KR: [
"26",
"23"
]
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
hdchina: "15",
hdctv: "16",
ihd: "12",
hdwing: "10",
hdwtv: "11",
kishd: "17",
openmv: "7",
hdc: "22",
diy: "23",
khq: "6",
exren: "30",
joma: "26",
anonymous: "25",
crss: "24",
ebp: "18",
don: "19",
esir: "20",
trollhd: "29",
wiki: "9",
beast: "4",
cmct: "2",
ngb: "8",
lu9998: "21",
taichi: "28",
u2: "27",
enichi: "31",
arey: "32",
other: "5"
}
}
},
HDDolby: {
url: "https://www.hddolby.com",
host: "hddolby.com",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="douban_id"]'
},
tags: {
chinese_audio: "#tag_gy",
diy: "#tag_diy",
chinese_subtitle: "#tag_zz",
cantonese_audio: "#tag_yy",
hdr: "#tag_hdr10",
hdr10_plus: "#tag_hdrm",
dolby_vision: "#tag_db"
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
x264: "3",
hevc: "2",
x265: "4",
h265: "2",
mpeg2: "6",
mpeg4: "0",
vc1: "5",
xvid: "0",
dvd: "0"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "1",
bluray: "2",
remux: "3",
encode: "10",
web: "6",
hdtv: "5",
dvd: "8",
dvdrip: "8",
other: "0"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "1",
"1080p": "2",
"1080i": "3",
"720p": "4",
"576p": "5",
"480p": "5"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
dream: "1",
hdo: "9",
dbtv: "10",
nazorip: "12",
mteam: "2",
frds: "7",
wiki: "4",
beast: "11",
chd: "5",
cmct: "6",
pthome: "3",
other: "8"
}
}
},
HDF: {
url: "https://hdf.world",
host: "hdf.world",
siteType: "gazelle",
icon: '',
asSource: false,
asTarget: false,
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
params: {
order_way: "desc",
order_by: "time",
searchstr: "{name}",
group_results: "1",
action: "basic"
}
}
},
HDHome: {
url: "https://hdhome.org",
host: "hdhome.org",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="douban_id"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
tags: {
chinese_audio: "#tag_gy",
diy: "#tag_diy",
cantonese_audio: "#tag_yy",
chinese_subtitle: "#tag_zz",
hdr: "#tag_hdr10",
hdr10_plus: "#tag_hdrm",
dolby_vision: "#tag_db"
},
category: {
selector: "#browsecat",
map: {
movie: [
"411",
"412",
"413",
"414",
"415",
"450",
"499",
"416"
],
tv: [
"425",
"426",
"471",
"427",
"428",
"429",
"430",
"452",
"431"
],
tvPack: [
"432",
"433",
"434",
"435",
"436",
"437",
"438",
"502"
],
documentary: [
"417",
"418",
"419",
"420",
"421",
"451",
"500",
"422"
],
concert: "441",
sport: [
"442",
"443"
],
cartoon: [
"444",
"445",
"446",
"447",
"448",
"454",
"449",
"501"
],
variety: []
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "12",
x264: "1",
x265: "2",
h265: "2",
mpeg2: "4",
mpeg4: "1",
vc1: "3",
xvid: "5",
dvd: "5"
}
},
source: {
selector: 'select[name="source_sel"]',
map: {
uhdbluray: "9",
bluray: "1",
hdtv: "4",
dvd: "3",
web: "7",
vhs: "8",
hddvd: "8"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "15",
dd: "15",
"dd+": "15",
dts: "3",
truehd: "13",
lpcm: "14",
dtshdma: "11",
atmos: "12",
dtsx: "17"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: [
"10",
"499",
"500",
"502",
"501"
],
bluray: [
"1",
"450",
"451",
"452",
"453",
"454"
],
remux: [
"3",
"415",
"421",
"430",
"437",
"448"
],
encode: [
"7",
"411",
"412",
"413",
"414",
"416",
"417",
"418",
"419",
"420",
"422",
"425",
"426",
"471",
"427",
"428",
"429",
"431",
"432",
"433",
"434",
"435",
"436",
"438",
"444",
"445",
"446",
"447",
"449"
],
web: [
"11",
"411",
"412",
"413",
"414",
"416",
"417",
"418",
"419",
"420",
"422",
"425",
"426",
"471",
"427",
"429",
"431",
"432",
"433",
"434",
"436",
"438",
"444",
"445",
"446",
"447",
"449"
],
hdtv: [
"5",
"412",
"413",
"416",
"418",
"419",
"422",
"424",
"426",
"471",
"427",
"428",
"431",
"433",
"434",
"435",
"438",
"442",
"443",
"445",
"446",
"449"
],
dvd: [
"",
"411",
"417",
"425",
"432",
"444"
],
dvdrip: [
"7",
"411",
"417",
"425",
"432",
"444"
],
other: ""
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": [
"1",
"499",
"416",
"500",
"422",
"431",
"438",
"502",
"449",
"501"
],
"1080p": [
"2",
"414",
"420",
"429",
"436",
"447"
],
"1080i": [
"3",
"424",
"428",
"435",
"443"
],
"720p": [
"4",
"413",
"419",
"423",
"427",
"434",
"442",
"446"
],
"576p": [
"5",
"411",
"417",
"425",
"432",
"444"
],
"480p": [
"5",
"411",
"417",
"425",
"432",
"444"
]
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
"3201": "20",
"969154968": "22",
hdhome: "1",
hdh: "2",
hdhtv: "3",
hdhpad: "4",
hdhweb: "12",
shma: "17",
tvman: "21",
arin: "19",
ttg: "6",
mteam: "7",
other: "11"
}
}
},
HDMaYi: {
url: "http://hdmayi.com",
host: "hdmayi.com",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "2",
x264: "6",
hevc: "3",
x265: "5",
h265: "1",
mpeg2: "7",
mpeg4: "4",
vc1: "7",
xvid: "7",
dvd: "7"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "1",
bluray: "1",
remux: "2",
encode: "4",
web: "5",
hdtv: "6",
dvd: "7",
dvdrip: "4",
other: "0",
cd: "8"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "1",
"1080p": "2",
"1080i": "3",
"720p": "4",
"576p": "5",
"480p": "5"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
hds: "1",
chd: "2",
mt: "3",
wiki: "4",
cmct: "5",
cnxp: "6",
hdh: "7",
fgt: "8",
mz: "9",
other: "10"
}
}
},
HDPOST: {
url: "https://pt.hdpost.top",
host: "hdpost.top",
siteType: "UNIT3D",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload/1",
needDoubanInfo: true,
seedDomSelector: "#meta-info+.meta-general>.panel:first table tr:last",
search: {
path: "/torrents",
params: {
name: "{name}",
imdb: "{imdb}"
}
},
name: {
selector: "#title"
},
description: {
selector: "#upload-form-description"
},
imdb: {
selector: "#autoimdb"
},
tmdb: {
selector: "#autotmdb"
},
mediaInfo: {
selector: 'textarea[name="mediainfo"]'
},
anonymous: {
selector: '.radio-inline:first input[name="anonymous"]'
},
category: {
selector: "#browsecat",
map: {
movie: "1",
tv: "2",
tvPack: "2"
}
},
videoType: {
selector: "#autotype",
map: {
uhdbluray: "1",
bluray: "1",
remux: "2",
encode: "3",
web: "4",
hdtv: "6",
dvd: "1",
dvdrip: "12",
other: ""
}
},
resolution: {
selector: "#autores",
map: {
"4320p": "1",
"2160p": "2",
"1080p": "3",
"1080i": "4",
"720p": "5",
"576p": "6",
"480p": "8"
}
}
},
HDRoute: {
url: "http://hdroute.org",
host: "hdroute.org",
siteType: "NexusPHP",
icon: '',
asSource: false,
asTarget: true,
uploadPath: "/upload.php",
search: {
path: "/browse.php",
imdbOptionKey: "4",
nameOptionKey: "0",
replaceKey: [
"tt",
""
],
params: {
s: "{name}",
dp: "0",
add: "0",
action: "s",
or: "4",
imdb: "{imdb}"
}
},
name: {
selector: "#title_eng"
},
subtitle: {
selector: 'input[name="title_sub"]'
},
description: {
selector: 'textarea[name="description"]'
},
poster: 'input[name="poster_big"]',
imdb: {
selector: "#upload-imdb_url"
},
anonymous: {
selector: 'input[name="is_anonymous"]'
},
tags: {
chinese_audio: 'input[name="is_mandrain"]',
cantonese_audio: 'input[name="is_cantonese"]',
diy: 'input[name="is_diyed"]',
chinese_subtitle: 'input[name="is_chs_sub_incl"]'
},
category: {
selector: "#type_category",
map: {
movie: "1",
tv: "3",
tvPack: "3",
documentary: "2",
concert: "5",
sport: "6",
cartoon: "4",
variety: "9"
}
},
videoCodec: {
selector: "#type_codec",
map: {
h264: "1",
hevc: "7",
x264: "1",
x265: "7",
h265: "7",
mpeg2: "3",
mpeg4: "1",
vc1: "2",
xvid: "4",
dvd: "3"
}
},
audioCodec: {
selector: "#type_audio",
map: {
aac: "9",
ac3: "5",
dd: "5",
"dd+": "5",
flac: "7",
dts: "4",
truehd: "3",
lpcm: "1",
dtshdma: "2",
atmos: "2",
dtsx: "4"
}
},
videoType: {
selector: "#type_medium",
map: {
uhdbluray: "1",
bluray: "1",
remux: "2",
encode: "4",
web: "6",
hddvd: "6",
hdtv: "3",
dvd: "6",
dvdrip: "6",
other: "6"
}
},
resolution: {
selector: "#type_resolution",
map: {
"2160p": "7",
"1080p": "1",
"1080i": "2",
"720p": "4",
"576p": "6",
"480p": "6"
}
}
},
HDSky: {
url: "https://hdsky.me",
host: "hdsky.me",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: 'input[name="name"]'
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="url_douban"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "411",
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "12",
x264: "10",
x265: "13",
h265: "12",
mpeg2: "4",
mpeg4: "1",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "12",
dd: "12",
"dd+": "12",
flac: "1",
dts: "3",
truehd: "11",
lpcm: "13",
dtshdma: "10",
atmos: "17",
dtsx: "16"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "13",
bluray: "1",
remux: "3",
encode: "7",
web: "11",
hddvd: "2",
hdtv: "5",
dvd: "6",
dvdrip: "6",
other: "0"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "5",
"1080p": "1",
"1080i": "2",
"720p": "3",
"576p": "4",
"480p": "4"
}
}
},
HDSpace: {
url: "https://hd-space.org",
host: "hd-space.org",
siteType: "HDSpace",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#mcol>table>tbody>tr:last table:first>tbody>tr:nth-child(2)",
needDoubanInfo: true,
uploadPath: "/index.php?page=upload",
search: {
path: "/index.php",
imdbOptionKey: "2",
nameOptionKey: "0",
replaceKey: [
"tt",
""
],
params: {
search: "{imdb}",
page: "torrents",
options: "{optionKey}",
order: 4,
by: 2
}
},
name: {
selector: "#filename"
},
imdb: {
selector: 'input[name="imdb"]'
},
description: {
selector: 'textarea[name="info"]'
},
anonymous: {
selector: 'input[name="anonymous"][value="true"]'
},
category: {
selector: 'select[name="category"]',
map: {
movie: [
"15",
"40",
"16",
"18",
"19",
"41"
],
tv: [
"15",
"40",
"16",
"21",
"22"
],
tvPack: [
"15",
"40",
"16",
"21",
"22"
],
documentary: [
"15",
"40",
"16",
"24",
"25"
],
cartoon: [
"15",
"40",
"16",
"27",
"28"
],
concert: [
"15",
"40",
"16",
"31"
]
}
},
videoType: {
map: {
uhdbluray: [
"15"
],
bluray: [
"15"
],
remux: [
"40"
],
encode: [
"18",
"19",
"41",
"21",
"22",
"24",
"25",
"27",
"28",
"31"
],
web: [
"18",
"19",
"41",
"21",
"22",
"24",
"25",
"27",
"28",
"31"
],
hdtv: [
"18",
"19",
"41",
"21",
"22",
"24",
"25",
"27",
"28",
"31"
]
}
},
resolution: {
map: {
"2160p": [
"15",
"40",
"16",
"41"
],
"1080p": [
"19",
"22",
"25",
"28",
"31"
],
"1080i": [
"19",
"22",
"25",
"28",
"31"
],
"720p": [
"18",
"21",
"24",
"24",
"31"
]
}
}
},
HDT: {
url: "https://hd-torrents.org",
host: "hd-torrents.org",
siteType: "HDT",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: ".listadetails>tbody>tr:nth-child(2)",
needDoubanInfo: true,
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "2",
nameOptionKey: "3",
params: {
search: "{imdb}",
options: "{optionKey}",
order: "size",
by: "DESC"
}
},
name: {
selector: 'input[name="filename"]'
},
imdb: {
selector: 'input[name="infosite"]'
},
description: {
selector: 'textarea[name="info"]'
},
tags: {
hdr: 'input[name="HDR10"]',
hdr10_plus: 'input[name="HDR10Plus"]',
dolby_vision: 'input[name="DolbyVision"]'
},
anonymous: {
selector: 'input[name="anonymous"][value="true"]'
},
category: {
selector: 'select[name="category"]',
map: {
movie: [
"70",
"1",
"71",
"2",
"64",
"5",
"3",
"63"
],
tv: [
"72",
"59",
"73",
"60",
"65",
"30",
"38"
],
tvPack: [
"72",
"59",
"73",
"60",
"65",
"30",
"38"
],
documentary: [
"70",
"1",
"71",
"2",
"64",
"5",
"3",
"63"
],
cartoon: [
"70",
"1",
"71",
"2",
"64",
"5",
"3",
"63"
],
concert: [
"61",
"62",
"66",
"57",
"45",
"44"
],
variety: [
"72",
"59",
"73",
"60",
"65",
"30",
"38"
]
}
},
videoType: {
map: {
uhdbluray: [
"70",
"72"
],
bluray: [
"1",
"59",
"61"
],
remux: [
"71",
"2",
"62",
"73",
"60"
],
encode: [
"64",
"5",
"3",
"65",
"30",
"38",
"66",
"57",
"45"
],
web: [
"64",
"5",
"3",
"65",
"30",
"38",
"66",
"57",
"45"
],
hdtv: [
"64",
"5",
"3",
"65",
"30",
"38",
"66",
"57",
"45"
]
}
},
resolution: {
map: {
"2160p": [
"70",
"72",
"71",
"73",
"64",
"65",
"66"
],
"1080p": [
"1",
"59",
"61",
"2",
"60",
"62",
"5",
"30",
"57"
],
"1080i": [
"1",
"59",
"61",
"2",
"60",
"62",
"5",
"30",
"57"
],
"720p": [
"3",
"38",
"45"
]
}
}
},
HDTime: {
url: "https://hdtime.org",
host: "hdtime.org",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
mediaInfo: {
selector: 'textarea[name="technical_info"]'
},
tags: {
diy: 'input[type="checkbox"][name="tags[]"][value="8"]',
chinese_audio: 'input[type="checkbox"][name="tags[]"][value="16"]',
chinese_subtitle: 'input[type="checkbox"][name="tags[]"][value="32"]',
hdr: 'input[type="checkbox"][name="tags[]"][value="64"]',
hdr10_plus: 'input[type="checkbox"][name="tags[]"][value="64"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "12",
x264: "10",
x265: "12",
h265: "12",
mpeg2: "4",
mpeg4: "1",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "1 ",
bluray: "1",
remux: "3",
encode: "7",
web: "7",
hddvd: "2",
hdtv: "5",
dvd: "6",
dvdrip: "6",
other: "0"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
hdtime: "6",
hdt: "12",
vtime: "15",
padtime: "7",
cmct: "8",
wiki: "4",
beast: "3",
chd: "2",
other: "5"
}
}
},
HDU: {
url: "https://pt.hdupt.com",
host: "hdupt.com",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "14",
x264: "16",
x265: "14",
h265: "14",
mpeg2: "18",
mpeg4: "18",
vc1: "2",
xvid: "3",
dvd: "18"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "2",
dd: "2",
"dd+": "2",
flac: "7",
dts: "4",
truehd: "3",
lpcm: "11",
dtshdma: "1",
atmos: "17",
dtsx: "16"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "11",
bluray: "1",
remux: "3",
encode: "7",
web: "10",
hddvd: "2",
hdtv: "5",
dvd: "6",
dvdrip: "6",
other: "0"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "5",
"1080p": "1",
"1080i": "2",
"720p": "3",
"576p": "4",
"480p": "4"
}
},
area: {
selector: 'select[name="processing_sel"]',
map: {
CN: "1",
US: "2",
EU: "2",
HK: "3",
TW: "3",
JP: "4",
KR: "5",
IND: "6",
SEA: "8",
OT: "7"
}
}
},
HaresClub: {
url: "https://club.hares.top",
host: "hares.top",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="pt_gen[imdb][link]"]'
},
douban: {
selector: 'input[name="pt_gen[douban][link]"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
mediaInfo: {
selector: 'textarea[name="technical_info"]'
},
tags: {
chinese_audio: 'input[name="tags[]"][value="32"]',
cantonese_audio: 'input[name="tags[]"][value="64"]',
diy: 'input[name="tags[]"][value="1024"]',
hdr: 'input[name="tags[]"][value="4096"]',
hdr10_plus: 'input[name="tags[]"][value="8192"]',
dolby_vision: 'input[name="tags[]"][value="16384"]',
chinese_subtitle: 'input[name="tags[]"][value="256"]'
},
category: {
selector: 'select[name="type"]',
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "409",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "6",
x264: "8",
x265: "7",
h265: "6",
mpeg2: "4",
mpeg4: "9",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "13",
dd: "13",
mp3: "4",
"dd+": "13",
flac: "1",
dts: "3",
truehd: "9",
lpcm: "14",
dtshdma: "11",
atmos: "8",
dtsx: "10",
ape: "2",
ogg: "5",
wav: "15"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "2",
bluray: "2",
remux: "3",
encode: "4",
web: "5",
hdtv: "8",
dvd: "0",
dvdrip: "0",
other: "0"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"4320p": "5",
"2160p": "6",
"1080p": "1",
"1080i": "2",
"720p": "3"
}
},
area: {
selector: 'select[name="processing_sel"]',
map: {
chd: "4",
hds: "5",
wiki: "6",
cmct: "8",
beast: "9",
hdc: "10",
frds: "11",
pter: "12",
bhd: "13",
pth: "14",
other: "15"
}
}
},
KEEPFRDS: {
url: "https://pt.keepfrds.com",
host: "keepfrds.com",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: false,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
needDoubanInfo: true,
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
}
},
KG: {
url: "https://karagarga.in",
host: "karagarga.in",
siteType: "KG",
icon: '',
asSource: true,
asTarget: false,
uploadPath: "/upload.php",
seedDomSelector: ".outer h1~table:first>tbody>tr:nth-child(6)",
needDoubanInfo: true,
search: {
path: "/browse.php",
imdbOptionKey: "imdb",
nameOptionKey: "title",
params: {
search: "{imdb}",
search_type: "{optionKey}",
sort: "size",
d: "DESC"
}
}
},
LemonHD: {
url: "https://lemonhd.org",
host: "lemonhd.org",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
uploadPath: "/upload_movie.php",
search: {
path: "/torrents.php",
imdbOptionKey: "imdb",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="douban_url"]'
},
tags: {
chinese_audio: 'input[name="tag_gy"]',
diy: "#tagDIY",
cantonese_audio: 'input[name="tag_yy"]',
chinese_subtitle: 'input[name="tag_zz"]',
the_criterion_collection: 'input[name="tag_cc"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "406",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "10",
x264: "12",
x265: "11",
h265: "10",
mpeg2: "4",
mpeg4: "1",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "8",
ac3: "14",
dd: "14",
"dd+": "14",
flac: "7",
dts: "6",
truehd: "2",
lpcm: "15",
dtshdma: "5",
atmos: "1",
dtsx: "4"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "9",
bluray: "1",
remux: "3",
encode: "7",
web: "11",
hdtv: "5",
dvd: "6",
dvdrip: "7",
hddvd: "2",
other: "4"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"4320p": "6",
"2160p": "1",
"1080p": "2",
"1080i": "2",
"720p": "4",
"576p": "5",
"480p": "5"
}
},
area: {
selector: 'select[name="processing_sel"]',
map: {
CN: "1",
US: "3",
EU: "3",
HK: "2",
TW: "2",
JP: "4",
KR: "4",
OT: "5"
}
}
},
MTeam: {
url: "https://kp.m-team.cc",
host: "m-team.cc",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(6)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
tags: {
chinese_audio: "#l_dub",
diy: "#l_diy",
chinese_subtitle: "#l_sub"
},
category: {
selector: "#browsecat",
map: {
movie: [
"401",
"419",
"420",
"421",
"439"
],
tv: [
"403",
"402",
"435",
"438"
],
tvPack: [
"403",
"402",
"435",
"438"
],
documentary: "404",
concert: "406",
sport: "407",
cartoon: "405",
app: "422",
ebook: "427",
magazine: "427",
audioBook: "427"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "16",
h265: "16",
x264: "1",
x265: "16",
mpeg2: "4",
mpeg4: "15",
vc1: "2",
xvid: "3"
}
},
videoType: {
map: {
uhdbluray: [
"421",
"438"
],
bluray: [
"421",
"438"
],
remux: "439",
encode: [
"401",
"419",
"403",
"402"
],
web: [
"419",
"402"
],
hdtv: [
"419",
"402"
],
dvd: [
"420",
"435"
],
dvdrip: [
"401",
"403"
],
other: ""
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": [
"6",
"419",
"402"
],
"1080p": [
"1",
"419",
"402"
],
"1080i": [
"2",
"419",
"402"
],
"720p": [
"3",
"419",
"402"
],
"576p": [
"5",
"401",
"403"
],
"480p": [
"5",
"401",
"403"
]
}
},
area: {
selector: 'select[name="processing_sel"]',
map: {
CN: "1",
US: "2",
EU: "2",
HK: "3",
TW: "3",
JP: "4",
KR: "5",
OT: "6"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
mteam: "9",
mpad: "10",
tnp: "23",
mteamtv: "17",
kishd: "7",
bmdru: "6",
onehd: "18",
cnhk: "19",
stbox: "20",
r2hd: "21",
pack: "8",
geek: "24"
}
}
},
NYPT: {
url: "https://nanyangpt.com",
host: "nanyangpt.com",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="dburl"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "406",
concert: "407",
sport: "405",
cartoon: "403",
variety: "404"
}
}
},
OurBits: {
url: "https://ourbits.club",
host: "ourbits.club",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: 'input[name="name"]'
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
poster: 'input[name="picture"]',
imdb: {
selector: 'input[name="url"][type="text"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
tags: {
chinese_audio: "#tagGY",
diy: "#tagDIY",
cantonese_audio: "#tag_yy",
chinese_subtitle: "#tagZZ",
hdr: "#tagHDR10",
hdr10_plus: "#tagHDR10P",
dolby_vision: "#tagDB"
},
category: {
selector: 'select[name="type"]',
map: {
movie: "401",
"3d": "402",
tv: "412",
tvPack: "405",
documentary: "410",
concert: "419",
sport: "415",
cartoon: "411",
variety: "413"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "12",
hevc: "14",
x264: "12",
x265: "14",
h265: "14",
mpeg2: "15",
mpeg4: "12",
vc1: "16",
xvid: "17",
dvd: "18"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "7",
ac3: "6",
dd: "6",
"dd+": "6",
flac: "13",
dts: "4",
truehd: "2",
lpcm: "5",
dtshdma: "1",
atmos: "14",
dtsx: "21"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "12",
bluray: "1",
remux: "4",
encode: "7",
web: "9",
hdtv: "5",
dvd: "2",
dvdrip: "2",
other: "0"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "5",
"1080p": "1",
"1080i": "2",
"720p": "3",
"576p": "4",
"480p": "4"
}
},
area: {
selector: 'select[name="processing_sel"]',
map: {
CN: "1",
US: "2",
EU: "2",
HK: "3",
TW: "3",
JP: "4",
KR: "5",
OT: "6"
}
}
},
PTHome: {
url: "https://www.pthome.net",
host: "pthome.net",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="douban_id"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
tags: {
chinese_audio: "#tag_gy",
diy: "#tag_diy",
cantonese_audio: "#tag_yy",
chinese_subtitle: "#tag_zz",
hdr: "#tag_hdr10",
hdr10_plus: "#tag_hdrm",
dolby_vision: "#tag_db"
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "408",
sport: "407",
cartoon: "405",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
x264: "1",
hevc: "6",
x265: "6",
h265: "6",
mpeg2: "4",
mpeg4: "1",
vc1: "2",
xvid: "5",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "18",
dd: "18",
"dd+": "18",
flac: "1",
dts: "3",
truehd: "20",
lpcm: "21",
dtshdma: "19",
atmos: "19",
dtsx: "3"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "12",
bluray: "1",
remux: "3",
encode: "15",
web: "10",
hdtv: "5",
dvd: "2",
dvdrip: "15",
other: "11"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"4320p": "10",
"2160p": "5",
"1080p": "1",
"1080i": "2",
"720p": "3",
"576p": "4",
"480p": "4"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
pthome: "19",
pth: "21",
pthweb: "20",
pthtv: "22",
pthaudio: "23",
pthebook: "24",
pthmusic: "25",
other: "5"
}
}
},
PTN: {
url: "https://piratethenet.org",
host: "piratethenet.org",
siteType: "PTN",
icon: '',
asSource: false,
asTarget: true,
uploadPath: "/upload.php",
search: {
path: "/browse.php",
params: {
name: "{name}",
imdb: "{imdb}"
}
},
name: {
selector: "#name"
},
description: {
selector: "#descr"
},
mediaInfo: {
selector: 'textarea[name="mediainfo"]'
}
},
PTP: {
url: "https://passthepopcorn.me",
host: "passthepopcorn.me",
siteType: "gazelle",
icon: '',
asSource: true,
asTarget: true,
needDoubanInfo: true,
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
params: {
action: "advanced",
searchstr: "{imdb}"
}
},
sourceInfo: {
editionTags: {
"10-bit": "10_bit",
"2-Disc Set": "2_disc_set",
"2D/3D Edition": "2d_3d_edition",
"2in1": "2_in_1",
"3D": "3d",
"3D Anaglyph": "3d_anaglyph",
"3D Full SBS": "3d_full_sbs",
"3D Half OU": "3d_half_ou",
"3D Half SBS": "3d_half_sbs",
"4K Remaster": "4k_remaster",
"4K Restoration": "4k_restoration",
"Director's Cut": "director_s_cut",
"Dolby Atmos": "dolby_atmos",
"Dolby Vision": "dolby_vision",
"Dual Audio": "dual_audio",
"English Dub": "english_dub",
"Extended Cut": "extended_edition",
"Extended Edition": "extended_edition",
Extras: "extras",
HDR10: "hdr10",
"HDR10+": "hdr10_plus",
"Masters of Cinema": "masters_of_cinema",
Scene: "scene",
"The Criterion Collection": "the_criterion_collection",
"Theatrical Cut": "theatrical_cut",
Trumpable: null,
"Two-Disc Set": "two_disc_set",
Remux: "remux",
Reported: null,
Rifftrax: "rifftrax",
Uncut: "uncut",
Unrated: "unrated",
"Warner Archive Collection": "warner_archive_collection",
"With Commentary": "with_commentary"
}
},
description: {
selector: "#release_desc"
},
poster: "#image",
imdb: {
selector: "#imdb"
},
anonymous: {
selector: 'input[name="uplver"]'
},
mediaInfo: {
selector: "#Media_BDInfo"
},
screenshots: {
selector: "#url_vimages"
},
category: {
selector: "#categories",
map: {
movie: "Feature Film",
tv: "Miniseries",
tvPack: "Miniseries",
documentary: "Feature Film",
concert: "Live Performance"
}
},
videoCodec: {
selector: "#codec",
map: {
h264: "H.264",
hevc: "H.265",
x264: "x264",
x265: "x265",
h265: "H.265",
mpeg2: "Other",
mpeg4: "H.264",
vc1: "Other",
xvid: "XviD",
DVD5: "DVD5",
DVD9: "DVD9",
BD100: "BD100",
BD66: "BD66",
BD50: "BD50",
BD25: "BD25"
}
},
source: {
selector: "#source",
map: {
uhdbluray: "Blu-ray",
bluray: "Blu-ray",
hdtv: "HDTV",
dvd: "DVD",
web: "WEB",
vhs: "VHS",
hddvd: "HD-DVD"
}
},
resolution: {
selector: "#resolution",
map: {
"2160p": "2160p",
"1080p": "1080p",
"1080i": "1080i",
"720p": "720p",
"576p": "576p",
"480p": "480p",
NTSC: "NTSC",
PAL: "PAL",
other: "Other"
}
}
},
PTSBAO: {
url: "https://ptsbao.club",
host: "ptsbao.club",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: "#small_descr"
},
description: {
selector: 'textarea[name="descr"]'
},
imdb: {
selector: 'input[name="imdburl"][type="text"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
tags: {
chinese_subtitle: 'input[type="checkbox"][name="zz"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
concert: "414",
sport: "409",
cartoon: "405",
variety: "403"
}
},
source: {
selector: "#medium_sel",
map: {
uhdbluray: "10",
bluray: "1",
hdtv: "5",
dvd: "3",
web: "2",
vhs: "9",
hddvd: "9"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "6",
x264: "1",
x265: "6",
h265: "6",
mpeg2: "4",
mpeg4: "5",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
audioCodec: {
selector: "#audiocodec_sel",
map: {
aac: "6",
ac3: "11",
dd: "10",
"dd+": "10",
dts: "3",
truehd: "9",
lpcm: "12",
dtshdma: "8",
atmos: "8",
dtsx: "13",
flac: "1"
}
},
videoType: {
selector: "#source_sel",
map: {
uhdbluray: "92",
bluray: "55",
remux: "88",
encode: [
"3",
"91",
"92"
],
web: "4",
hdtv: "94",
dvd: "89",
dvdrip: "89",
other: ""
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": [
"5",
"92"
],
"1080p": [
"1",
"3"
],
"1080i": "1",
"720p": [
"2",
"91"
],
"576p": "3",
"480p": "4"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
ffansbd: "8",
ops: "11",
ffansweb: "12",
ffanstv: "13",
hqc: "10",
ttg: "3",
hdc: "6",
chd: "2",
hdsky: "9",
cmct: "4",
frds: "5",
other: "7",
ffansdvd: "14",
fhdmv: "15",
enichi: "16"
}
}
},
PTer: {
url: "https://pterclub.com",
host: "pterclub.com",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="douban"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
tags: {
chinese_audio: "#guoyu",
diy: "#diy",
cantonese_audio: "#yueyu",
chinese_subtitle: "#zhongzi"
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "404",
tvPack: "404",
documentary: "402",
concert: "406",
sport: "407",
cartoon: "403",
variety: "405"
}
},
videoType: {
selector: 'select[name="source_sel"]',
map: {
uhdbluray: "1",
bluray: "2",
remux: "3",
encode: "6",
web: "5",
hdtv: "4",
dvd: "7",
dvdrip: "7",
other: "15"
}
},
area: {
selector: 'select[name="team_sel"]',
map: {
CN: "1",
US: "4",
EU: "4",
HK: "2",
TW: "3",
JP: "6",
KR: "5",
IND: "7",
OT: "8"
}
}
},
PrivateHD: {
url: "https://privatehd.to",
host: "privatehd.to",
siteType: "AvistaZ",
icon: '',
asSource: true,
asTarget: false,
uploadPath: "/upload.php",
seedDomSelector: "#content-area .block:last table:first>tbody>tr:nth-child(3)",
needDoubanInfo: true,
search: {
path: "/browse.php",
params: {
search: "{name}",
in: "1",
order: "size",
sort: "desc"
}
}
},
SSD: {
url: "https://springsunday.net",
host: "springsunday.net",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: "#small_descr"
},
description: {
selector: "#descr"
},
poster: "#url_poster",
imdb: {
selector: "#url"
},
anonymous: {
selector: 'input[name="uplver"]'
},
mediaInfo: {
selector: "#Media_BDInfo"
},
screenshots: {
selector: "#url_vimages"
},
category: {
selector: "#browsecat",
map: {
movie: "501",
tv: "502",
tvPack: "502",
documentary: "503",
concert: "507",
sport: "506",
cartoon: "504",
variety: "505"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "2",
hevc: "1",
x264: "2",
x265: "1",
h265: "1",
mpeg2: "4",
mpeg4: "2",
vc1: "3",
xvid: "",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "5",
ac3: "4",
dd: "4",
"dd+": "4",
flac: "7",
dts: "3",
truehd: "2",
lpcm: "6",
dtshdma: "1",
atmos: "3",
dtsx: "3"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "1",
bluray: "1",
remux: "4",
encode: "6",
web: "7",
hdtv: "5",
dvd: "3",
dvdrip: "10",
other: ""
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "1",
"1080p": "2",
"1080i": "3",
"720p": "4",
"576p": "5",
"480p": "5"
}
},
area: {
selector: 'select[name="source_sel"]',
map: {
CN: "1",
US: "9",
EU: "9",
HK: "2",
TW: "2",
JP: "10",
KR: "10",
OT: "3"
}
}
},
SoulVoice: {
url: "https://pt.soulvoice.club",
host: "soulvoice.club",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
needDoubanBookInfo: true,
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "404",
cartoon: "405",
sport: "407",
concert: "406",
variety: "403"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "2",
h265: "2",
x264: "1",
x265: "2",
mpeg2: "5",
mpeg4: "1",
vc1: "5",
xvid: "5"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "3",
"1080p": "1",
"1080i": "2",
"720p": "4",
"576p": "4",
"480p": "4"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
hds: "1",
chd: "2",
frds: "3",
cmct: "4",
other: "5"
}
}
},
SubHD: {
url: "https://subhd.tv",
host: "subhd.tv",
icon: '',
asSource: false,
asTarget: false,
search: {
path: "/search/{name}"
}
},
TCCF: {
url: "https://et8.org",
host: "et8.org",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
anonymous: {
selector: 'input[name="uplver"]'
},
category: {
selector: "#browsecat",
map: {
movie: "622",
tv: "623",
tvPack: "623",
documentary: "404",
concert: "626",
sport: "627",
cartoon: "627",
variety: "627",
app: "625",
ebook: "629",
magazine: "631",
comics: "632",
audioBook: "633",
onlineCourse: "634"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
x264: "7",
hevc: "8",
x265: "6",
h265: "8",
mpeg2: "4",
mpeg4: "1",
vc1: "2",
xvid: "3",
dvd: "4"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "4",
dd: "4",
"dd+": "4",
flac: "1",
dts: "3",
truehd: "9",
lpcm: "10",
dtshdma: "8",
atmos: "8",
dtsx: "3"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "10",
bluray: "1",
remux: "5",
encode: "11",
web: "9",
hdtv: "6",
dvd: "7",
dvdrip: "4",
other: "0"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "5",
"1080p": "1",
"1080i": "2",
"720p": "3",
"576p": "4",
"480p": "4"
}
},
team: {
selector: 'select[name="team_sel"]',
map: {
torrentccf: "1",
tccf: "1",
tlf: "2",
bmdru: "3",
catedu: "4",
madfox: "5",
other: "7"
}
}
},
TJUPT: {
url: "https://www.tjupt.org",
host: "tjupt.org",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
seedDomSelector: "#top~table:first>tbody>tr:nth-child(5)",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: "#descr"
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: "#external_url"
},
category: {
selector: "#browsecat",
map: {
movie: "401",
tv: "402",
tvPack: "402",
documentary: "411",
concert: "406",
sport: "407",
cartoon: "405",
variety: "403"
}
}
},
TLF: {
url: "https://pt.eastgame.org",
host: "eastgame.org",
siteType: "NexusPHP",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#top~table:first>tbody>tr:nth-child(3)",
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
imdbOptionKey: "4",
nameOptionKey: "0",
params: {
incldead: "0",
search_area: "{optionKey}",
search: "{imdb}",
sort: "5",
type: "desc"
}
},
name: {
selector: "#name"
},
subtitle: {
selector: 'input[name="small_descr"]'
},
description: {
selector: 'textarea[name="descr"]'
},
imdb: {
selector: 'input[name="url"][type="text"]'
},
douban: {
selector: 'input[name="douban_url"]'
},
category: {
selector: "#browsecat",
map: {
movie: "438",
tv: "440",
tvPack: "440",
documentary: "443",
cartoon: "442",
sport: "444",
concert: "445",
variety: "441"
}
},
videoCodec: {
selector: 'select[name="codec_sel"]',
map: {
h264: "1",
hevc: "6",
h265: "6",
x264: "1",
x265: "6",
mpeg2: "4",
mpeg4: "0",
vc1: "2",
xvid: "3"
}
},
audioCodec: {
selector: 'select[name="audiocodec_sel"]',
map: {
aac: "6",
ac3: "9",
dd: "9",
"dd+": "9",
flac: "1",
dts: "10",
truehd: "14",
lpcm: "12",
dtshdma: "11",
atmos: "13",
dtsx: "10"
}
},
videoType: {
selector: 'select[name="medium_sel"]',
map: {
uhdbluray: "10",
bluray: "1",
remux: "3",
encode: "7",
web: "4",
hdtv: "5",
dvd: "6",
hddvd: "1",
dvdrip: "6",
other: "9"
}
},
resolution: {
selector: 'select[name="standard_sel"]',
map: {
"2160p": "6",
"1080p": "1",
"1080i": "2",
"720p": "3",
"576p": "4",
"480p": "4"
}
},
area: {
selector: 'select[name="processing_sel"]',
map: {
CN: "1",
US: "2",
EU: "2",
HK: "3",
TW: "3",
JP: "4",
KR: "5",
OT: "6"
}
}
},
TMDB: {
url: "https://www.themoviedb.org",
host: "www.themoviedb.org",
icon: '',
asSource: false,
asTarget: false,
search: {
path: "/search?query={name}"
}
},
TTG: {
url: "https://totheglory.im",
host: "totheglory.im",
siteType: "TTG",
icon: '',
asSource: true,
asTarget: true,
seedDomSelector: "#main_table h1~table:first>tbody>tr:nth-child(2)",
uploadPath: "/upload.php",
search: {
path: "/browse.php",
replaceKey: [
"tt",
"imdb"
],
params: {
search_field: "{imdb}",
sort: "5",
type: "desc",
c: "M"
}
},
name: {
selector: 'input[name="name"]'
},
description: {
selector: 'textarea[name="descr"]'
},
imdb: {
selector: 'input[name="imdb_c"]'
},
anonymous: {
selector: 'select[name="anonymity"]',
value: "yes"
},
category: {
selector: 'select[name="type"]',
map: {
movie: [
"51",
"52",
"53",
"54",
"108",
"109"
],
tv: [
"69",
"70",
"73",
"74",
"75",
"76"
],
tvPack: [
"87",
"88",
"99",
"90"
],
documentary: [
"62",
"63",
"67"
],
concert: "59",
sport: "57",
cartoon: "58",
variety: [
"103",
"60",
"101"
]
}
},
videoType: {
map: {
uhdbluray: [
"109"
],
bluray: [
"54",
"109",
"67"
],
remux: [
"53",
"108",
"63",
"70",
"75"
],
encode: [
"53",
"63",
"70",
"75",
"52",
"62",
"69",
"76",
"108"
],
web: [
"53",
"62",
"63",
"70",
"75",
"52",
"69",
"76",
"108",
"87",
"88",
"99",
"90"
],
hdtv: [
"53",
"63",
"70",
"75",
"52",
"62",
"69",
"76",
"108",
"87",
"88",
"99",
"90"
],
dvd: [
"51"
],
dvdrip: [
"51"
],
other: ""
}
},
resolution: {
map: {
"2160p": [
"108",
"109",
"67"
],
"1080p": [
"53",
"63",
"70",
"75",
"54",
"67",
"87",
"88",
"99",
"90"
],
"1080i": [
"53",
"63",
"70",
"75",
"87",
"88",
"99",
"90"
],
"720p": [
"52",
"62",
"69",
"76",
"87",
"88",
"99",
"90"
],
"576p": "51",
"480p": "51"
}
},
area: {
map: {
CN: [
"76",
"75",
"90"
],
US: [
"69",
"70",
"87"
],
EU: [
"69",
"70",
"87"
],
HK: [
"76",
"75",
"90"
],
TW: [
"76",
"75",
"90"
],
JP: [
"73",
"88",
"101"
],
KR: [
"74",
"99",
"103"
],
OT: ""
}
}
},
TeamHD: {
url: "https://teamhd.org",
host: "teamhd.org",
siteType: "TeamHD",
icon: '',
asSource: true,
asTarget: false,
seedDomSelector: "#details_hop",
needDoubanInfo: true,
search: {
path: "/browse",
params: {
incldead: "0",
search: "{name}"
}
}
},
UHDBits: {
url: "https://uhdbits.org",
host: "uhdbits.org",
siteType: "gazelle",
icon: '',
asSource: true,
asTarget: true,
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
params: {
order_way: "desc",
order_by: "size",
searchstr: "{imdb}"
}
},
needDoubanInfo: true,
description: {
selector: "#release_desc"
},
imdb: {
selector: "#imdbid"
},
anonymous: {
selector: "#anonymous"
},
mediaInfo: {
selector: 'textarea[name="mediainfo"]'
},
category: {
selector: "#categories",
map: {
movie: "0",
tv: "2",
tvPack: "2",
music: "1"
}
},
videoType: {
selector: "#media",
map: {
uhdbluray: "Blu-ray",
bluray: "Blu-ray",
remux: "Remux",
encode: "Encode",
web: "WEB-DL",
hdtv: "HDTV",
dvdrip: "Encode",
other: "Others"
}
},
videoCodec: {
selector: "#codec",
map: {
h264: "AVC/H.264",
hevc: "HEVC",
x264: "x264",
x265: "x265",
h265: "HEVC",
mpeg2: "MPEG-2",
mpeg4: "AVC/H.264",
vc1: "VC-1",
dvd: "MPEG"
}
},
resolution: {
selector: "#format",
map: {
"2160p": "2160p",
"1080p": "1080p",
"1080i": "1080i",
"720p": "720p",
"576p": "Others",
"480p": "Others"
}
}
},
bB: {
url: "https://baconbits.org",
host: "baconbits.org",
siteType: "gazelle",
icon: '',
asSource: false,
asTarget: true,
uploadPath: "/upload.php",
search: {
path: "/torrents.php",
params: {
searchstr: "{name}",
order_by: "s4",
order_way: "desc",
disablegrouping: 1
}
},
name: {
selector: "#title"
},
description: {
selector: "#desc"
},
category: {
selector: "#categories",
map: {
movie: "Movies",
tv: "TV",
tvPack: "TV",
documentary: "Movies",
cartoon: "Anime",
app: "Applications",
ebook: "E-Books",
magazine: "Magazines",
audioBook: "Audiobooks",
comics: "Comics"
}
},
source: {
selector: 'select[name="source"]',
map: {
uhdbluray: "BluRay",
bluray: "BluRay",
hdtv: "HDTV",
dvd: "DVD9",
web: "WEB-DL",
webrip: "WebRip",
vhs: "VHSRip",
hddvd: "HD-DVD",
bluray3d: "BluRay 3D"
}
},
videoCodec: {
selector: 'select[name="videoformat"]',
map: {
h264: "H.264",
hevc: "H.265",
x264: "x264",
x265: "x265",
h265: "H.265",
mpeg2: "MPEG-2",
mpeg4: "H.264",
vc1: "VC-1",
xvid: "XVid",
dvd: "MPEG-2"
}
},
audioCodec: {
selector: 'select[name="audioformat"]',
map: {
aac: "AAC",
ac3: "AC-3",
dd: "AC-3",
"dd+": "AC-3",
dts: "DTS",
truehd: "True-HD",
lpcm: "PCM",
flac: "FLAC",
dtshdma: "DTS-HD",
atmos: "Dolby Atmos",
dtsx: "DTS:X",
mp3: "MP3"
}
},
format: {
selector: 'select[name="container"]',
map: {
mkv: "MKV",
mp4: "MP4",
avi: "AVI",
ts: "TS",
wmv: "WMV",
vob: "VOB",
m2ts: "m2ts"
}
},
resolution: {
selector: 'select[name="resolution"]',
map: {
"2160p": "2160p",
"1080p": "1080p",
"1080i": "1080i",
"720p": "720p",
"480p": "480p",
"480i": "480i",
other: "SD"
}
},
mediaInfo: {
selector: "#release_desc"
},
poster: {
selector: "#image"
},
year: {
selector: 'input[name="year"]'
},
tags: {
selector: "#tags"
}
},
iTS: {
url: "http://shadowthein.net",
host: "shadowthein.net",
siteType: "its",
asSource: false,
asTarget: true,
icon: '',
seedDomSelector: "h1~.line>tbody>tr:nth-child(2)",
needDoubanInfo: true,
uploadPath: "/upload.php",
search: {
path: "/browse.php",
params: {
incldead: 1,
search: "{imdb}",
search_in: "names",
sort: 5,
type: "desc"
}
},
name: {
selector: 'input[name="name"]'
},
imdb: {
selector: 'input[name="imdblink"]'
},
description: {
selector: 'textarea[name="descr"]'
},
mediaInfo: {
selector: 'textarea[name="mediainfo"]'
},
tags: {
hdr: 'input[name="HDR10"]',
hdr10_plus: 'input[name="HDR10Plus"]',
dolby_vision: 'input[name="DolbyVision"]'
},
anonymous: {
selector: 'input[name="anonymous"][value="true"]'
},
category: {
selector: 'select[name="type"]',
map: {
movie: "68",
tv: "65",
concert: "61",
music: "6",
ebook: "26"
}
}
},
"nzbs.in": {
url: "https://nzbs.in",
host: "nzbs.in",
siteType: "nzb",
icon: '',
asSource: false,
asTarget: false,
search: {
path: "/search/{name}",
params: {
t: -1,
ob: "size_desc"
}
}
},
zimuku: {
url: "http://zimuku.org",
host: "zimuku.org",
icon: '',
asSource: false,
asTarget: false,
search: {
path: "/search",
params: {
q: "{imdb}"
}
}
},
\u8C46\u74E3\u7535\u5F71: {
url: "https://search.douban.com",
host: "search.douban.com",
icon: '',
asSource: false,
asTarget: false,
search: {
path: "/movie/subject_search",
params: {
search_text: "{imdb}"
}
}
},
\u8C46\u74E3\u8BFB\u4E66: {
url: "https://search.douban.com",
host: "search.douban.com",
icon: '',
asSource: false,
asTarget: false,
search: {
path: "/book/subject_search?search_text={name}"
}
}
};
// src/const.js
var TORRENT_INFO = {
title: "",
subtitle: "",
description: "",
originalDescription: "",
year: "",
category: "",
videoType: "",
format: "",
source: "",
videoCodec: "",
audioCodec: "",
resolution: "",
area: "",
doubanUrl: "",
doubanInfo: "",
imdbUrl: "",
tags: {
diy: false,
chinese_audio: false,
cantonese_audio: false,
chinese_subtitle: false,
dolby_atoms: false,
dts_x: false,
hdr: false,
dolby_vision: false
},
otherTags: {},
mediaInfo: "",
mediaInfos: [],
screenshots: [],
comparisons: [],
movieAkaName: "",
movieName: "",
sourceSite: "",
sourceSiteType: "",
size: "",
isForbidden: false,
poster: ""
};
var DOUBAN_SUGGEST_API = "https://www.douban.com/search?cat=1002&q={query}";
var PT_GEN_API = "https://media.pttool.workers.dev";
var TMDB_API_URL = "https://api.tmdb.org";
var TMDB_API_KEY = "3d62cb1443c6b34b61262ab332aaf78c";
var USE_CHINESE = /zh-cn|zh-hk|zh-tw/.test(navigator.language.toLowerCase());
var getSiteName = (host) => {
let siteName = "";
try {
Object.keys(PT_SITE).forEach((key) => {
const hostName = PT_SITE[key].host;
const matchReg = new RegExp(hostName, "i");
if (hostName && host.match(matchReg)) {
siteName = key;
}
});
return siteName;
} catch (error) {
if (error.message !== "end loop") {
console.log(error);
}
}
};
var getSortedSiteKeys = () => {
return Object.keys(PT_SITE).sort((a, b) => {
const isChineseReg = /[\u4e00-\u9fa5]+/;
if (isChineseReg.test(a) && !isChineseReg.test(b)) {
return 1;
}
if (!isChineseReg.test(a) && isChineseReg.test(b)) {
return -1;
}
return a.toLowerCase().localeCompare(b.toLowerCase());
});
};
var SORTED_SITE_KEYS = getSortedSiteKeys();
var EUROPE_LIST = ["Albania", "Andorra", "Armenia", "Austria", "Azerbaijan", "Belarus", "Belgium", "Bosnia and Herzegovina", "Bulgaria", "Croatia", "Cyprus", "Czech Republic", "Denmark", "Estonia", "Finland", "France", "Georgia", "Germany", "Greece", "Hungary", "Iceland", "Ireland", "Italy", "Kazakhstan", "Latvia", "Liechtenstein", "Lithuania", "Luxembourg", "Malta", "Moldova", "Monaco", "Montenegro", "Netherlands", "North Macedonia", "Norway", "Poland", "Portugal", "Romania", "Russia", "San Marino", "Serbia", "Slovakia", "Slovenia", "Spain", "Sweden", "Switzerland", "Turkey", "Ukraine", "United Kingdom", "UK", "Vatican City"];
var CURRENT_SITE_NAME = getSiteName(location.host);
var CURRENT_SITE_INFO = PT_SITE[CURRENT_SITE_NAME];
var HDB_TEAM = ["Chotab", "CRiSC", "CtrlHD", "DON", "EA", "EbP", "Geek", "LolHD", "NTb", "RightSiZE", "SA89", "SbR", "TayTo", "VietHD"];
var NOTIFICATION_TEMPLATE = `
`;
// src/i18n.json
var en_US = {
\u8C46\u74E3\u94FE\u63A5\u83B7\u53D6\u5931\u8D25: "Failed to get Douban link",
\u8C46\u74E3ID\u83B7\u53D6\u5931\u8D25: "Failed to get Douban ID",
\u83B7\u53D6\u8C46\u74E3\u4FE1\u606F\u5931\u8D25: "Failed to get Douban data",
\u7F3A\u5C11IMDB\u4FE1\u606F: "Missing IMDB information",
\u83B7\u53D6\u5931\u8D25: "Request failed",
\u83B7\u53D6\u6210\u529F: "Data request successful",
\u8BF7\u6C42\u5931\u8D25: "Request failed",
"\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5": "Upload failed, please try again",
ptpimg\u4E0A\u4F20\u5931\u8D25: "PtpImg upload failed",
\u8BF7\u5230\u914D\u7F6E\u9762\u677F\u4E2D\u586B\u5165ptpimg\u7684api_key: "Please enter the API_KEY of ptpimg in the setting panel",
\u5C01\u9762\u4E0A\u4F20\u5931\u8D25: "Failed to upload poster",
"\u6570\u636E\u52A0\u8F7D\u4E2D...": "Loading data...",
\u83B7\u53D6\u56FE\u7247\u5217\u8868\u5931\u8D25: "Failed to get list of images",
"\u8F6C\u6362\u4E2D...": "Converting...",
"\u8F6C\u6362\u6210\u529F\uFF01": "Converted!",
"\u83B7\u53D6\u4E2D...": "Requesting...",
\u7F3A\u5C11\u8C46\u74E3\u94FE\u63A5: "Missing Douban link",
"\u672C\u79CD\u5B50\u7981\u6B62\u8F6C\u8F7D\uFF0C\u786E\u5B9A\u8981\u7EE7\u7EED\u8F6C\u8F7D\u4E48\uFF1F": "Transfer of this torrent is prohibited, are you sure to continue?",
\u8BF7\u7B49\u5F85\u9875\u9762\u52A0\u8F7D\u5B8C\u6210: "Please wait for the page to load",
\u624B\u52A8\u8F93\u5165\u8C46\u74E3\u94FE\u63A5: "Enter the Douban link",
\u83B7\u53D6\u8C46\u74E3\u7B80\u4ECB: "Get data of Douban",
\u83B7\u53D6\u8C46\u74E3\u8BFB\u4E66\u7B80\u4ECB: "Get data of Douban Book",
\u8F6C\u7F29\u7565\u56FE: "Convert to thumbnails",
\u5FEB\u901F\u68C0\u7D22: "Quick search",
\u4E00\u952E\u7FA4\u8F6C: "Batch transfer",
\u5FEB\u6377\u64CD\u4F5C: "Quick operation",
\u4E00\u952E\u8F6C\u79CD: "Transfer to",
\u8F6C\u79CD\u7AD9\u70B9\u542F\u7528: "Select sites for the 'Transfer to' section",
\u6279\u91CF\u8F6C\u79CD\u542F\u7528: "Select sites for the 'Batch transfer' button",
\u4E00\u952E\u6279\u91CF\u8F6C\u53D1\u5230\u4EE5\u4E0B\u9009\u4E2D\u7684\u7AD9\u70B9: "One-click batch transfer to the selected sites below",
\u7AD9\u70B9\u641C\u7D22\u542F\u7528: "Select sites for the 'Quick search' section",
\u56FE\u5E8A\u914D\u7F6E: "Image Host Settings",
"\u5982\u4F55\u83B7\u53D6\uFF1F": "How to get it?",
\u989D\u5916\u529F\u80FD\u5173\u95ED: "Turn off extra features",
\u5173\u95ED\u8F6C\u7F29\u7565\u56FE\u529F\u80FD: "Remove the 'Convert to thumbnails' button",
\u5173\u95ED\u7AD9\u70B9\u56FE\u6807\u663E\u793A: "Remove the icons",
\u5173\u95ED\u8F6C\u5B58ptpimg\u529F\u80FD: "Remove the 'Upload screenshots to ptpimg' button",
\u4FDD\u5B58: "Save",
\u53D6\u6D88: "Cancel",
\u9519\u8BEF: "Error",
\u6210\u529F: "Success",
\u4FDD\u5B58\u672C\u5730\u7AD9\u70B9\u8BBE\u7F6E\u5931\u8D25: "Failed to save local site settings",
\u8BF7\u5148\u8BBE\u7F6E\u7FA4\u8F6C\u5217\u8868: "Please set up the group transfer list first",
"\u8F6C\u79CD\u9875\u9762\u5DF2\u6253\u5F00\uFF0C\u8BF7\u524D\u5F80\u5BF9\u5E94\u9875\u9762\u64CD\u4F5C": "The transfer pages have been opened, please go to the corresponding page to operate",
\u63D0\u793A: "Hint",
\u8F6C\u5B58\u622A\u56FE: "Upload screenshots to another host",
\u65E0\u9700\u8F6C\u5B58: "No need to upload",
"\u4E0A\u4F20\u4E2D\uFF0C\u8BF7\u7A0D\u5019...": "Uploading,be patient",
\u4E0D\u663E\u793A\u81F4\u8C22\u5185\u5BB9: "Do not show acknowledgments"
};
var zh_CN = {
\u8C46\u74E3\u94FE\u63A5\u83B7\u53D6\u5931\u8D25: "\u8C46\u74E3\u94FE\u63A5\u83B7\u53D6\u5931\u8D25",
\u8C46\u74E3ID\u83B7\u53D6\u5931\u8D25: "\u8C46\u74E3ID\u83B7\u53D6\u5931\u8D25",
\u83B7\u53D6\u8C46\u74E3\u4FE1\u606F\u5931\u8D25: "\u83B7\u53D6\u8C46\u74E3\u4FE1\u606F\u5931\u8D25",
\u7F3A\u5C11IMDB\u4FE1\u606F: "\u7F3A\u5C11IMDB\u4FE1\u606F",
\u83B7\u53D6\u5931\u8D25: "\u83B7\u53D6\u5931\u8D25",
\u83B7\u53D6\u6210\u529F: "\u83B7\u53D6\u6210\u529F",
\u8BF7\u6C42\u5931\u8D25: "\u8BF7\u6C42\u5931\u8D25",
"\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5": "\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",
ptpimg\u4E0A\u4F20\u5931\u8D25: "ptpimg\u4E0A\u4F20\u5931\u8D25",
\u8BF7\u5230\u914D\u7F6E\u9762\u677F\u4E2D\u586B\u5165ptpimg\u7684api_key: "\u8BF7\u5230\u914D\u7F6E\u9762\u677F\u4E2D\u586B\u5165ptpimg\u7684api_key",
\u5C01\u9762\u4E0A\u4F20\u5931\u8D25: "\u5C01\u9762\u4E0A\u4F20\u5931\u8D25",
"\u6570\u636E\u52A0\u8F7D\u4E2D...": "\u6570\u636E\u52A0\u8F7D\u4E2D...",
\u83B7\u53D6\u56FE\u7247\u5217\u8868\u5931\u8D25: "\u83B7\u53D6\u56FE\u7247\u5217\u8868\u5931\u8D25",
"\u8F6C\u6362\u4E2D...": "\u8F6C\u6362\u4E2D...",
"\u8F6C\u6362\u6210\u529F\uFF01": "\u8F6C\u6362\u6210\u529F\uFF01",
"\u83B7\u53D6\u4E2D...": "\u83B7\u53D6\u4E2D...",
\u7F3A\u5C11\u8C46\u74E3\u94FE\u63A5: "\u7F3A\u5C11\u8C46\u74E3\u94FE\u63A5",
"\u672C\u79CD\u5B50\u7981\u6B62\u8F6C\u8F7D\uFF0C\u786E\u5B9A\u8981\u7EE7\u7EED\u8F6C\u8F7D\u4E48\uFF1F": "\u672C\u79CD\u5B50\u7981\u6B62\u8F6C\u8F7D\uFF0C\u786E\u5B9A\u8981\u7EE7\u7EED\u8F6C\u8F7D\u4E48\uFF1F",
\u8BF7\u7B49\u5F85\u9875\u9762\u52A0\u8F7D\u5B8C\u6210: "\u8BF7\u7B49\u5F85\u9875\u9762\u52A0\u8F7D\u5B8C\u6210",
\u624B\u52A8\u8F93\u5165\u8C46\u74E3\u94FE\u63A5: "\u624B\u52A8\u8F93\u5165\u8C46\u74E3\u94FE\u63A5",
\u83B7\u53D6\u8C46\u74E3\u7B80\u4ECB: "\u83B7\u53D6\u8C46\u74E3\u7B80\u4ECB",
\u83B7\u53D6\u8C46\u74E3\u8BFB\u4E66\u7B80\u4ECB: "\u83B7\u53D6\u8C46\u74E3\u8BFB\u4E66\u7B80\u4ECB",
\u8F6C\u7F29\u7565\u56FE: "\u8F6C\u7F29\u7565\u56FE",
\u5FEB\u901F\u68C0\u7D22: "\u5FEB\u901F\u68C0\u7D22",
\u4E00\u952E\u7FA4\u8F6C: "\u4E00\u952E\u7FA4\u8F6C",
\u5FEB\u6377\u64CD\u4F5C: "\u5FEB\u6377\u64CD\u4F5C",
\u4E00\u952E\u8F6C\u79CD: "\u4E00\u952E\u8F6C\u79CD",
\u8F6C\u79CD\u7AD9\u70B9\u542F\u7528: "\u8F6C\u79CD\u7AD9\u70B9\u542F\u7528",
\u6279\u91CF\u8F6C\u79CD\u542F\u7528: "\u6279\u91CF\u8F6C\u79CD\u542F\u7528",
\u4E00\u952E\u6279\u91CF\u8F6C\u53D1\u5230\u4EE5\u4E0B\u9009\u4E2D\u7684\u7AD9\u70B9: "\u4E00\u952E\u6279\u91CF\u8F6C\u53D1\u5230\u4EE5\u4E0B\u9009\u4E2D\u7684\u7AD9\u70B9",
\u7AD9\u70B9\u641C\u7D22\u542F\u7528: "\u7AD9\u70B9\u641C\u7D22\u542F\u7528",
\u56FE\u5E8A\u914D\u7F6E: "\u56FE\u5E8A\u914D\u7F6E",
"\u5982\u4F55\u83B7\u53D6\uFF1F": "\u5982\u4F55\u83B7\u53D6\uFF1F",
\u989D\u5916\u529F\u80FD\u5173\u95ED: "\u989D\u5916\u529F\u80FD\u5173\u95ED",
\u5173\u95ED\u8F6C\u7F29\u7565\u56FE\u529F\u80FD: "\u5173\u95ED\u8F6C\u7F29\u7565\u56FE\u529F\u80FD",
\u5173\u95ED\u7AD9\u70B9\u56FE\u6807\u663E\u793A: "\u5173\u95ED\u7AD9\u70B9\u56FE\u6807\u663E\u793A",
\u5173\u95ED\u8F6C\u5B58ptpimg\u529F\u80FD: "\u5173\u95ED\u8F6C\u5B58ptpimg\u529F\u80FD",
\u4FDD\u5B58: "\u4FDD\u5B58",
\u53D6\u6D88: "\u53D6\u6D88",
\u9519\u8BEF: "\u9519\u8BEF",
\u6210\u529F: "\u6210\u529F",
\u4FDD\u5B58\u672C\u5730\u7AD9\u70B9\u8BBE\u7F6E\u5931\u8D25: "\u4FDD\u5B58\u672C\u5730\u7AD9\u70B9\u8BBE\u7F6E\u5931\u8D25",
\u8BF7\u5148\u8BBE\u7F6E\u7FA4\u8F6C\u5217\u8868: "\u8BF7\u5148\u8BBE\u7F6E\u7FA4\u8F6C\u5217\u8868",
"\u8F6C\u79CD\u9875\u9762\u5DF2\u6253\u5F00\uFF0C\u8BF7\u524D\u5F80\u5BF9\u5E94\u9875\u9762\u64CD\u4F5C": "\u8F6C\u79CD\u9875\u9762\u5DF2\u6253\u5F00\uFF0C\u8BF7\u524D\u5F80\u5BF9\u5E94\u9875\u9762\u64CD\u4F5C",
\u63D0\u793A: "\u63D0\u793A",
\u8F6C\u5B58\u622A\u56FE: "\u8F6C\u5B58\u622A\u56FE",
\u65E0\u9700\u8F6C\u5B58: "\u65E0\u9700\u8F6C\u5B58",
"\u4E0A\u4F20\u4E2D\uFF0C\u8BF7\u7A0D\u5019...": "\u4E0A\u4F20\u4E2D\uFF0C\u8BF7\u7A0D\u5019...",
\u4E0D\u663E\u793A\u81F4\u8C22\u5185\u5BB9: "\u4E0D\u663E\u793A\u81F4\u8C22\u5185\u5BB9"
};
var i18n_default = {
en_US,
"zh-CN": zh_CN
};
// src/common.js
var formatTorrentTitle = (title) => {
return title.replace(/\.(?!(\d+))/ig, " ").replace(/\.(?=\d{4}|48|57|72|2k|4k|7.1|6.1|5.1|4.1|2.0|1.0)/ig, " ").trim();
};
var handleError = (error) => {
showNotice({
text: error.message || error
});
};
var getDoubanInfo = async (doubanUrl) => {
try {
if (doubanUrl) {
const data = await fetch(doubanUrl, {
responseType: "text"
});
if (data) {
const doubanData = await getDataFromDoubanPage(data);
doubanData.format = getDoubanFormat(doubanData);
return doubanData;
} else {
if (doubanUrl.match(/\/book/)) {
throw data.error;
} else {
const doubanInfo = await getAnotherDoubanInfo(doubanUrl);
return doubanInfo;
}
}
} else {
throw $t("\u8C46\u74E3\u94FE\u63A5\u83B7\u53D6\u5931\u8D25");
}
} catch (error) {
handleError(error);
}
};
var getDataFromDoubanPage = async (domString) => {
const dom = new DOMParser().parseFromString(domString, "text/html");
const fetchAnchor = function(anchor) {
return anchor[0].nextSibling.nodeValue.trim();
};
const chineseTitle = $("title", dom).text().replace("(\u8C46\u74E3)", "").trim();
const foreignTitle = $('span[property="v:itemreviewed"]', dom).text().replace(chineseTitle, "").trim();
let aka = [];
let transTitle;
let thisTitle;
const akaAnchor = $('#info span.pl:contains("\u53C8\u540D")', dom);
if (akaAnchor.length > 0) {
aka = fetchAnchor(akaAnchor).split(" / ").sort(function(a, b) {
return a.localeCompare(b);
}).join("/");
aka = aka.split("/");
}
if (foreignTitle) {
transTitle = chineseTitle + (aka.length > 0 ? "/" + aka.join("/") : "");
thisTitle = foreignTitle;
} else {
transTitle = aka.join("/") || "";
thisTitle = chineseTitle;
}
transTitle = transTitle.split("/");
thisTitle = thisTitle.split("/");
const jsonData = JSON.parse($('head > script[type="application/ld+json"]', dom).html().replace(/(\r\n|\n|\r|\t)/gm, ""));
const rating = jsonData.aggregateRating ? jsonData.aggregateRating.ratingValue : 0;
const votes = jsonData.aggregateRating ? jsonData.aggregateRating.ratingCount : 0;
const director = jsonData.director ? jsonData.director : [];
const writer = jsonData.author ? jsonData.author : [];
const cast = jsonData.actor ? jsonData.actor : [];
const poster = jsonData.image.replace(/s(_ratio_poster|pic)/g, "l$1").replace(/img\d/, "img9");
const doubanLink = `https://movie.douban.com${jsonData.url}`;
let imdbId, imdbLink, imdbAverageRating, imdbVotes, imdbRating;
const imdbLinkAnchor = $('#info span.pl:contains("IMDb")', dom);
const hasImdb = imdbLinkAnchor.length > 0;
if (hasImdb) {
imdbId = fetchAnchor(imdbLinkAnchor);
imdbLink = `https://www.imdb.com/title/${imdbId}/`;
let imdbData = await fetch(`https://p.media-imdb.com/static-content/documents/v1/title/${imdbId}/ratings%3Fjsonp=imdb.rating.run:imdb.api.title.ratings/data.json`, {
responseType: "text"
});
imdbData = imdbData.replace(/(imdb\.rating\.run\()|\)/g, "");
imdbData = JSON.parse(imdbData);
if (imdbData.resource) {
imdbAverageRating = imdbData.resource.rating || 0;
imdbVotes = imdbData.resource.ratingCount || 0;
imdbRating = `${imdbAverageRating}/10 from ${imdbVotes} users`;
}
}
const year = " " + $("#content > h1 > span.year", dom).text().substr(1, 4);
const playdate = $('#info span[property="v:initialReleaseDate"]', dom).map(function() {
return $(this).text().trim();
}).toArray().sort(function(a, b) {
return new Date(a) - new Date(b);
});
const introductionDom = $('#link-report > span.all.hidden, #link-report > [property="v:summary"]', dom);
const summary = (introductionDom.length > 0 ? introductionDom.text() : "\u6682\u65E0\u76F8\u5173\u5267\u60C5\u4ECB\u7ECD").split("\n").map((a) => a.trim()).filter((a) => a.length > 0).join("\n");
const genre = $('#info span[property="v:genre"]', dom).map(function() {
return $(this).text().trim();
}).toArray();
const language = fetchAnchor($('#info span.pl:contains("\u8BED\u8A00")', dom));
const region = fetchAnchor($('#info span.pl:contains("\u5236\u7247\u56FD\u5BB6/\u5730\u533A")', dom));
const runtimeAnchor = $('#info span.pl:contains("\u5355\u96C6\u7247\u957F")', dom);
const runtime = runtimeAnchor[0] ? fetchAnchor(runtimeAnchor) : $('#info span[property="v:runtime"]', dom).text().trim();
const episodesAnchor = $('#info span.pl:contains("\u96C6\u6570")');
const episodes = episodesAnchor[0] ? fetchAnchor(episodesAnchor) : "";
let tags;
const tag_another = $('div.tags-body > a[href^="/tag"]', dom);
if (tag_another.length > 0) {
tags = tag_another.map(function() {
return $(this).text();
}).get();
}
const awardsPage = await fetch(`${doubanLink}/awards`, {
responseType: "text"
});
const awardsDoc = new DOMParser().parseFromString(awardsPage, "text/html");
const awards = $("#content > div > div.article", awardsDoc).html().replace(/[ \n]/g, "").replace(/<\/li>/g, " ").replace(/<\/a> ]*>/g, "\n").replace(/<[^>]+>/g, "").replace(/ /g, " ").replace(/ +\n/g, "\n").trim();
return {
imdb_link: imdbLink,
imdb_id: imdbId,
imdb_rating_average: imdbAverageRating,
imdb_votes: imdbVotes,
imdb_rating: `${imdbRating}/10 from ${imdbVotes} users`,
chinese_title: chineseTitle,
foreign_title: foreignTitle,
aka,
trans_title: transTitle,
this_title: thisTitle,
year,
playdate,
region,
genre,
language,
episodes,
duration: runtime,
introduction: summary,
douban_link: doubanLink,
douban_rating_average: rating || 0,
douban_votes: votes,
douban_rating: `${rating}/10 from ${votes} users`,
poster,
director,
cast,
writer,
awards,
tags
};
};
var getAnotherDoubanInfo = async (doubanUrl) => {
var _a, _b;
try {
if (doubanUrl) {
const doubanId = (_b = (_a = doubanUrl.match(/subject\/(\d+)/)) == null ? void 0 : _a[1]) != null ? _b : "";
if (!doubanId) {
throw $t("\u8C46\u74E3ID\u83B7\u53D6\u5931\u8D25");
}
const data = await fetch(`https://movie.querydata.org/api?id=${doubanId}`);
if (data && data.id) {
return formatDoubanInfo(data);
} else {
throw data.message || $t("\u83B7\u53D6\u8C46\u74E3\u4FE1\u606F\u5931\u8D25");
}
} else {
throw $t("\u8C46\u74E3\u94FE\u63A5\u83B7\u53D6\u5931\u8D25");
}
} catch (error) {
handleError(error);
}
};
var formatDoubanInfo = (data) => {
var _a;
const {
doubanId,
imdbId,
imdbRating,
imdbVotes,
dateReleased,
alias,
originalName,
doubanRating,
episodes,
doubanVotes,
year,
duration,
director,
data: info,
actor,
writer
} = data;
const [chineseInfo, englishInfo] = info;
const chineseTitle = chineseInfo.name;
const foreignTitle = englishInfo.name;
const directorArray = director.map((item) => {
return {
name: `${item.data[0].name} ${item.data[1].name}`
};
});
const actorArray = actor.map((item) => {
return {
name: `${item.data[0].name} ${item.data[1].name}`
};
});
const writerArray = writer.map((item) => {
return {
name: `${item.data[0].name} ${item.data[1].name}`
};
});
let transTitle = (_a = alias == null ? void 0 : alias.split("/")) != null ? _a : "";
if (chineseTitle !== originalName && !alias.includes(chineseTitle)) {
transTitle = [chineseTitle].concat(transTitle);
}
const formatData = {
imdb_link: `https://www.imdb.com/title/${imdbId}`,
imdb_id: imdbId,
imdb_rating_average: imdbRating,
imdb_votes: imdbVotes,
imdb_rating: `${imdbRating}/10 from ${imdbVotes} users`,
chinese_title: chineseTitle,
foreign_title: foreignTitle,
aka: alias.split("/"),
trans_title: transTitle,
this_title: [originalName],
year,
playdate: [dateReleased == null ? void 0 : dateReleased.match(/\d+-\d+-\d+/)[0]],
region: info[0].country,
genre: chineseInfo.genre.split("/"),
language: chineseInfo.language,
episodes,
duration: `${duration / 60}\u5206\u949F`,
introduction: chineseInfo.description,
douban_link: `https://movie.douban.com/subject/${doubanId}`,
douban_rating_average: doubanRating || 0,
douban_votes: doubanVotes,
douban_rating: `${doubanRating}/10 from ${doubanVotes} users`,
poster: chineseInfo.poster,
director: directorArray,
cast: actorArray,
writer: writerArray
};
formatData.format = getDoubanFormat(formatData);
return formatData;
};
var getDoubanFormat = (data) => {
const {
poster,
this_title,
trans_title,
genre,
year: movieYear,
region,
language,
playdate,
imdb_rating,
imdb_link,
douban_rating,
douban_link,
episodes: showEpisodes,
duration: movieDuration,
imdb_rating_average,
director: directors,
writer: writers,
cast: actors,
introduction,
awards,
tags
} = data;
let descr = poster ? `[img]${poster}[/img]
` : "";
descr += trans_title ? `\u25CE\u8BD1\u3000\u3000\u540D\u3000${trans_title.join("/")}
` : "";
descr += this_title ? `\u25CE\u7247\u3000\u3000\u540D\u3000${this_title.join("/")}
` : "";
descr += movieYear ? `\u25CE\u5E74\u3000\u3000\u4EE3\u3000${movieYear.trim()}
` : "";
descr += region ? `\u25CE\u4EA7\u3000\u3000\u5730\u3000${region}
` : "";
descr += genre ? `\u25CE\u7C7B\u3000\u3000\u522B\u3000${genre.join(" / ")}
` : "";
descr += language ? `\u25CE\u8BED\u3000\u3000\u8A00\u3000${language}
` : "";
descr += playdate ? `\u25CE\u4E0A\u6620\u65E5\u671F\u3000${playdate.join(" / ")}
` : "";
descr += imdb_rating ? `\u25CEIMDb\u8BC4\u5206 ${imdb_rating_average}
` : "";
descr += imdb_link ? `\u25CEIMDb\u94FE\u63A5 ${imdb_link}
` : "";
descr += douban_rating ? `\u25CE\u8C46\u74E3\u8BC4\u5206\u3000${douban_rating}
` : "";
descr += douban_link ? `\u25CE\u8C46\u74E3\u94FE\u63A5\u3000${douban_link}
` : "";
descr += showEpisodes ? `\u25CE\u96C6\u3000\u3000\u6570\u3000${showEpisodes}
` : "";
descr += movieDuration ? `\u25CE\u7247\u3000\u3000\u957F\u3000${movieDuration}
` : "";
descr += directors && directors.length > 0 ? `\u25CE\u5BFC\u3000\u3000\u6F14\u3000${directors.map((x) => x.name).join(" / ")}
` : "";
descr += writers && writers.length > 0 ? `\u25CE\u7F16\u3000\u3000\u5267\u3000${writers.map((x) => x.name).join(" / ")}
` : "";
descr += actors && actors.length > 0 ? `\u25CE\u4E3B\u3000\u3000\u6F14\u3000${actors.map((x) => x.name).join("\n" + "\u3000".repeat(4) + " \u3000").trim()}
` : "";
descr += tags && tags.length > 0 ? `
\u25CE\u6807\u3000\u3000\u7B7E\u3000${tags.join(" | ")}
` : "";
descr += introduction ? `
\u25CE\u7B80\u3000\u3000\u4ECB
\u3000\u3000${introduction.replace(/\n/g, "\n" + "\u3000".repeat(2))}
` : "";
descr += awards ? `
\u25CE\u83B7\u5956\u60C5\u51B5
\u3000\u3000${awards.replace(/\n/g, "\n" + "\u3000".repeat(2))}
` : "";
return descr.trim();
};
var getDoubanIdByIMDB = async (query) => {
var _a, _b, _c;
try {
const imdbId = getIMDBIdByUrl(query);
const params = imdbId || query;
const url = DOUBAN_SUGGEST_API.replace("{query}", params);
const data = await fetch(url, {
responseType: "text"
});
const doc = new DOMParser().parseFromString(data, "text/html");
const linkDom = doc.querySelector(".result-list .result h3 a");
if (!linkDom) {
throw $t("\u8C46\u74E3ID\u83B7\u53D6\u5931\u8D25");
} else {
const {href, textContent} = linkDom;
const season = (_b = (_a = textContent.match(/第(.+?)季/)) == null ? void 0 : _a[1]) != null ? _b : "";
const doubanId = (_c = decodeURIComponent(href).match(/subject\/(\d+)/)) == null ? void 0 : _c[1];
return {
id: doubanId,
season,
title: textContent
};
}
} catch (error) {
handleError(error);
}
};
var getIMDBData = async (imdbUrl) => {
try {
if (!imdbUrl) {
throw new Error("$t(\u7F3A\u5C11IMDB\u4FE1\u606F)");
}
const data = await fetch(`${PT_GEN_API}?url=${imdbUrl}`);
if (data && data.success) {
return data;
} else {
throw data.error || $t("\u8BF7\u6C42\u5931\u8D25");
}
} catch (error) {
handleError(error);
}
};
var transferImgs = async (screenshot, authToken, imgHost = "https://imgbb.com/json") => {
try {
const isHdbHost = !!screenshot.match(/i\.hdbits\.org/);
const formData = new FormData();
if (isHdbHost) {
const promiseArray = [urlToFile(screenshot)];
const [fileData] = await Promise.all(promiseArray);
formData.append("type", "file");
formData.append("source", fileData);
} else {
formData.append("type", "url");
formData.append("source", screenshot);
}
formData.append("action", "upload");
formData.append("timestamp", Date.now());
formData.append("auth_token", authToken);
const res = await fetch(imgHost, {
method: "POST",
data: formData,
timeout: 3e5
});
if (res.status_txt !== "OK") {
throw $t("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
}
if (res.image) {
return res.image;
} else {
throw $t("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
}
} catch (error) {
handleError(error);
}
};
var getPreciseCategory = (torrentInfo, category) => {
var _a, _b;
const {description, title, subtitle, doubanInfo} = torrentInfo;
const movieGenre = (_b = (_a = (description + doubanInfo).match(/(类\s+别)\s+(.+)?/)) == null ? void 0 : _a[2]) != null ? _b : "";
if (category === "movie") {
if (movieGenre.match(/动画/)) {
category = "cartoon";
} else if (movieGenre.match(/纪录/)) {
category = "documentary";
}
} else if (category == null ? void 0 : category.match(/tv/)) {
if (title.match(/(s0?\d{1,2})?e(p)?\d{1,2}/i) || (subtitle == null ? void 0 : subtitle.match(/第[^\s]集/))) {
category = "tv";
} else {
category = "tvPack";
}
}
return category;
};
var getUrlParam = (key) => {
const reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
const regArray = location.search.substr(1).match(reg);
if (regArray) {
return unescape(regArray[2]);
}
return "";
};
var getAudioCodecFromTitle = (title) => {
if (!title) {
return "";
}
title = title.replace(/:|-|\s/g, "");
if (title.match(/atmos/i)) {
return "atmos";
} else if (title.match(/dtshdma/i)) {
return "dtshdma";
} else if (title.match(/dtsx/i)) {
return "dtsx";
} else if (title.match(/dts/i)) {
return "dts";
} else if (title.match(/truehd/i)) {
return "truehd";
} else if (title.match(/lpcm/i)) {
return "lpcm";
} else if (title.match(/flac/i)) {
return "flac";
} else if (title.match(/aac/i)) {
return "aac";
} else if (title.match(/DD\+|DDP|DolbyDigitalPlus/i)) {
return "dd+";
} else if (title.match(/DD|DolbyDigital/i)) {
return "dd";
} else if (title.match(/ac3/i)) {
return "ac3";
}
return "";
};
var getVideoCodecFromTitle = (title, videoType = "") => {
title = title.replace(/\.|-/g, "");
if (title.match(/x264/i) || title.match(/h264|avc/i) && videoType === "encode") {
return "x264";
} else if (title.match(/h264|AVC/i)) {
return "h264";
} else if (title.match(/x265/i) || title.match(/h265|hevc/i) && videoType === "encode") {
return "x265";
} else if (title.match(/hevc|h265/i)) {
return "hevc";
} else if (title.match(/vc-?1/i)) {
return "vc1";
} else if (title.match(/mpeg-?2/i)) {
return "mpeg2";
} else if (title.match(/mpeg-?4/i)) {
return "mpeg4";
}
return "";
};
var getFilterImages = (bbcode) => {
if (!bbcode) {
return [];
}
let allImages = bbcode.match(/(\[url=(http(s)*:\/{2}.+?)\])?\[img\](.+?)\[\/img](\[url\])?/g);
if (allImages && allImages.length > 0) {
allImages = allImages.map((img) => {
if (img.match(/\[url=.+?\]/)) {
return img + "[/url]";
}
return img;
});
return allImages.filter((item) => {
return !item.match(/MoreScreens|PTer\.png|PTerREMUX\.png|PTerWEB\.png|CS\.png|Ourbits_info|GDJT|douban|logo|(2019\/03\/28\/5c9cb8f8216d7\.png)|_front|(info_01\.png)|(screens\.png)|(04\/6b\/Ggp5ReQb_o)|(ce\/e7\/KCmGFMOB_o)/);
});
}
return [];
};
var getScreenshotsFromBBCode = (bbcode) => {
const allImages = getFilterImages(bbcode);
if (allImages && allImages.length > 0) {
return getOriginalImgUrl(allImages);
}
return "";
};
var getOriginalImgUrl = (imgArray) => {
return imgArray.map((item) => {
var _a, _b, _c, _d;
let imgUrl = item;
if (item.match(/\[url=http(s)*:.+/)) {
imgUrl = (_a = item.match(/=(([^\]])+)/)) == null ? void 0 : _a[1];
if (imgUrl.match(/img\.hdbits\.org/)) {
const imgId = item.match(/\[url=https:\/\/img\.hdbits\.org\/(\w+)?\]/)[1];
imgUrl = `https://i.hdbits.org/${imgId}.png`;
} else if (!imgUrl.match(/\.(jpg|png|gif|bmp)$/)) {
imgUrl = (_b = item.match(/img\](([^[])+)/)) == null ? void 0 : _b[1];
} else if (item.match(/https:\/\/pixhost\.to/)) {
const hostNumber = (_c = item.match(/img\]https:\/\/t(\d+)\./)) == null ? void 0 : _c[1];
imgUrl = imgUrl.replace(/(pixhost\.to)\/show/, `img${hostNumber}.$1/images`);
}
} else if (item.match(/\[img\]/)) {
imgUrl = (_d = item.match(/img\](([^[])+)/)) == null ? void 0 : _d[1];
}
return imgUrl;
});
};
var getSourceFromTitle = (title) => {
if (title.match(/(uhd|2160|4k).*(blu(-)?ray|remux)/i)) {
return "uhdbluray";
} else if (title.match(/blu(-)?ray|remux/i)) {
return "bluray";
} else if (title.match(/hdtv/i)) {
return "hdtv";
} else if (title.match(/web(-(rip|dl))+/i)) {
return "web";
} else if (title.match(/hddvd/i)) {
return "hddvd";
} else if (title.match(/dvd/i)) {
return "dvd";
} else if (title.match(/vhs/i)) {
return "vhs";
}
return "other";
};
var getSubTitle = (data) => {
var _a, _b;
const {chinese_title: chineseTitle, this_title: originalTitle, trans_title: transTitle} = data;
let title = "";
if (chineseTitle.match(/[\u4e00-\u9fa5]+/)) {
title += chineseTitle;
}
const moreTitle = originalTitle.concat(transTitle).filter((item) => title !== item);
let seasonEpisode = (_b = (_a = TORRENT_INFO.title.match(/S\d+EP?(\d+)?/i)) == null ? void 0 : _a[1]) != null ? _b : "";
seasonEpisode = seasonEpisode.replace(/^0/i, "");
const episode = seasonEpisode ? ` \u7B2C${seasonEpisode}\u96C6` : "";
return `${title}${moreTitle.length > 0 ? "/" : ""}${moreTitle.join("/")}${episode}`;
};
var getAreaCode = (area) => {
const europeList = EUROPE_LIST;
if (area) {
if (area.match(/USA|US|Canada|CA|美国|加拿大/i)) {
return "US";
} else if (europeList.includes(area) || area.match(/欧|英|法|德|俄|意|苏联|EU/i)) {
return "EU";
} else if (area.match(/Japan|日本|JP/i)) {
return "JP";
} else if (area.match(/Korea|韩国|KR/i)) {
return "KR";
} else if (area.match(/Taiwan|台湾|TW/i)) {
return "TW";
} else if (area.match(/Hong\s?Kong|香港|HK/i)) {
return "HK";
} else if (area.match(/CN|China|大陆|中|内地|Mainland/i)) {
return "CN";
}
}
return "OT";
};
var getBDType = (size) => {
const GBSize = size / 1e9;
if (GBSize < 5) {
return "DVD5";
} else if (GBSize < 9) {
return "DVD9";
} else if (GBSize < 25) {
return "BD25";
} else if (GBSize < 50) {
return "BD50";
} else if (GBSize < 66) {
return "BD66";
} else if (GBSize < 100) {
return "BD100";
}
};
var getTMDBIdByIMDBId = async (imdbid) => {
try {
const url = `${TMDB_API_URL}/3/find/${imdbid}?api_key=${TMDB_API_KEY}&language=en&external_source=imdb_id`;
const data = await fetch(url);
const isMovie = data.movie_results && data.movie_results.length > 0;
const isTV = !data.tv_results && data.tv_results.length > 0;
if (!isMovie && !isTV) {
throw $t("\u8BF7\u6C42\u5931\u8D25");
}
const tmdbData = isMovie ? data.movie_results[0] : data.tv_results[0];
return tmdbData;
} catch (error) {
return {};
}
};
var getTMDBVideos = async (tmdbId) => {
const url = `${TMDB_API_URL}/3/movie/${tmdbId}/videos?api_key=${TMDB_API_KEY}&language=en`;
const data = await fetch(url);
return data.results || [];
};
var getIMDBIdByUrl = (imdbLink) => {
const imdbIdArray = /tt\d+/.exec(imdbLink);
if (imdbIdArray && imdbIdArray[0]) {
return imdbIdArray[0];
}
return "";
};
var getSize = (size) => {
if (!size) {
return "";
}
if (size.match(/T/i)) {
return parseFloat(size) * 1024 * 1024 * 1024 * 1024 || 0;
} else if (size.match(/G/i)) {
return parseFloat(size) * 1024 * 1024 * 1024 || 0;
} else if (size.match(/M/i)) {
return parseFloat(size) * 1024 * 1024 || 0;
} else if (size.match(/K/i)) {
return parseFloat(size) * 1024 || 0;
}
return "";
};
var getInfoFromMediaInfo = (mediaInfo) => {
var _a, _b, _c;
if (!mediaInfo) {
return false;
}
const mediaArray = mediaInfo.split(/\n\s*\n/);
const [generalPart, videoPart] = mediaArray;
const secondVideoPart = mediaArray.filter((item) => item.startsWith("Video #2"));
const [audioPart, ...otherAudioPart] = mediaArray.filter((item) => item.startsWith("Audio"));
const textPart = mediaArray.filter((item) => item.startsWith("Text"));
const completeName = getMediaValueByKey("Complete name", generalPart);
const format = (_c = (_b = (_a = completeName == null ? void 0 : completeName.match(/\.(\w+)$/i)) == null ? void 0 : _a[1]) == null ? void 0 : _b.toLowerCase()) != null ? _c : "";
const fileName = completeName.replace(/\.\w+$/i, "");
const fileSize = getSize(getMediaValueByKey("File size", generalPart));
const {videoCodec, hdrFormat, isDV} = getVideoCodecByMediaInfo(videoPart, generalPart, secondVideoPart);
const {audioCodec, channelName, languageArray} = getAudioCodecByMediaInfo(audioPart, otherAudioPart);
const subtitleLanguageArray = textPart.map((item) => {
return getMediaValueByKey("Language", item);
});
const mediaTags = getMediaTags(audioCodec, channelName, languageArray, subtitleLanguageArray, hdrFormat, isDV);
const resolution = getResolution(videoPart);
return {
fileName,
fileSize,
format,
subtitles: subtitleLanguageArray,
videoCodec,
audioCodec,
resolution,
mediaTags
};
};
var getMediaValueByKey = (key, mediaInfo) => {
if (!mediaInfo) {
return "";
}
const keyRegStr = key.replace(/\s/, "\\s*").replace(/(\(|\))/g, "\\$1");
const reg = new RegExp(`${keyRegStr}\\s*:\\s([^
]+)`, "i");
return mediaInfo.match(reg) ? mediaInfo.match(reg)[1] : "";
};
var getResolution = (mediaInfo) => {
const height = parseInt(getMediaValueByKey("Height", mediaInfo).replace(/\s/g, ""));
const width = parseInt(getMediaValueByKey("Width", mediaInfo).replace(/\s/g, ""));
const ScanType = getMediaValueByKey("Scan type", mediaInfo);
if (height > 1080) {
return "2160p";
} else if (height > 720 && ScanType === "Progressive") {
return "1080p";
} else if (height > 720 && ScanType !== "Progressive") {
return "1080i";
} else if (height > 576 || width > 1024) {
return "720p";
} else if (height > 480 || width === 1024) {
return "576p";
} else if (width >= 840 || height === 480) {
return "480p";
} else if (width && height) {
return `${width}x${height}`;
} else {
return "";
}
};
var getMediaTags = (audioCodec, channelName, languageArray, subtitleLanguageArray, hdrFormat, isDV) => {
const hasChineseAudio = languageArray.includes("Chinese");
const hasChineseSubtitle = subtitleLanguageArray.includes("Chinese");
const mediaTags = {};
if (hasChineseAudio) {
mediaTags.chinese_audio = true;
}
if (languageArray.includes("Cantonese")) {
mediaTags.cantonese_audio = true;
}
if (hasChineseSubtitle) {
mediaTags.chinese_subtitle = true;
}
if (hdrFormat) {
if (hdrFormat.match(/HDR10\+/i)) {
mediaTags.hdr10_plus = true;
} else if (hdrFormat.match(/HDR/i)) {
mediaTags.hdr = true;
}
}
if (isDV) {
mediaTags.dolby_vision = true;
}
if (audioCodec.match(/dtsx|atmos/ig)) {
mediaTags.dts_x = true;
} else if (audioCodec.match(/atmos/ig)) {
mediaTags.dolby_atmos = true;
}
return mediaTags;
};
var getVideoCodecByMediaInfo = (mainVideo, generalPart, secondVideo) => {
const generalFormat = getMediaValueByKey("Format", generalPart);
const videoFormat = getMediaValueByKey("Format", mainVideo);
const videoFormatVersion = getMediaValueByKey("Format version", mainVideo);
const videoCodeId = getMediaValueByKey("Codec ID", mainVideo);
const hdrFormat = getMediaValueByKey("HDR format", mainVideo);
const isDV = hdrFormat.match(/Dolby\s*Vision/i) || secondVideo.length > 0 && getMediaValueByKey("HDR format", secondVideo[0]).match(/Dolby\s*Vision/i);
const isEncoded = !!getMediaValueByKey("Encoding settings", mainVideo);
let videoCodec = "";
if (generalFormat === "DVD Video") {
videoCodec = "mpeg2";
} else if (generalFormat === "MPEG-4") {
videoCodec = "mpeg4";
} else if (videoFormat === "MPEG Video" && videoFormatVersion === "Version 2") {
videoCodec = "mpeg2";
} else if (videoCodeId.match(/xvid/i)) {
videoCodec = "xvid";
} else if (videoFormat.match(/HEVC/i) && !isEncoded) {
videoCodec = "hevc";
} else if (videoFormat.match(/HEVC/i) && isEncoded) {
videoCodec = "x265";
} else if (videoFormat.match(/AVC/i) && isEncoded) {
videoCodec = "x264";
} else if (videoFormat.match(/AVC/i) && !isEncoded) {
videoCodec = "h264";
} else if (videoFormat.match(/VC-1/i)) {
videoCodec = "vc1";
}
return {
videoCodec,
hdrFormat,
isDV
};
};
var getAudioCodecByMediaInfo = (mainAudio, otherAudio = []) => {
const audioFormat = getMediaValueByKey("Format", mainAudio);
const audioChannels = getMediaValueByKey("Channel(s)", mainAudio);
const commercialName = getMediaValueByKey("Commercial name", mainAudio);
const languageArray = [mainAudio, ...otherAudio].map((item) => {
return getMediaValueByKey("Language", item);
});
let channelName = "";
let audioCodec = "";
const channelNumber = parseInt(audioChannels);
if (channelNumber && channelNumber >= 6) {
channelName = `${channelNumber - 1}.1`;
} else {
channelName = `${channelNumber}.0`;
}
if (audioFormat.match(/MLP FBA/i) && commercialName.match(/Dolby Atmos/i)) {
audioCodec = "atmos";
} else if (audioFormat.match(/MLP FBA/i) && !commercialName.match(/Dolby Atmos/i)) {
audioCodec = "truehd";
} else if (audioFormat.match(/AC-3/i) && commercialName.match(/Dolby Digital Plus/i)) {
audioCodec = "dd+";
} else if (audioFormat.match(/AC-3/i) && commercialName.match(/Dolby Digital/i)) {
audioCodec = "dd";
} else if (audioFormat.match(/AC-3/i)) {
audioCodec = "ac3";
} else if (audioFormat.match(/DTS XLL X/i)) {
audioCodec = "dtsx";
} else if (audioFormat.match(/DTS/i) && commercialName.match(/DTS-HD Master Audio/i)) {
audioCodec = "dtshdma";
} else if (audioFormat.match(/DTS/i)) {
audioCodec = "dts";
} else if (audioFormat.match(/FLAC/i)) {
audioCodec = "flac";
} else if (audioFormat.match(/AAC/i)) {
audioCodec = "aac";
} else if (audioFormat.match(/LPCM/i)) {
audioCodec = "lpcm";
}
return {
audioCodec,
channelName,
languageArray
};
};
var getInfoFromBDInfo = (bdInfo) => {
var _a, _b, _c, _d;
if (!bdInfo) {
return "";
}
const splitArray = bdInfo.split("Disc Title");
if (splitArray.length > 2) {
bdInfo = splitArray[1];
}
const videoMatch = bdInfo.match(/VIDEO:(\s|Codec|Bitrate|Description|Language|-)*((.|\n)*)AUDIO:/i);
const hasFileInfo = bdInfo.match(/FILES:/i);
const subtitleReg = new RegExp(`SUBTITLE(S)*:(\\s|Codec|Bitrate|Description|Language|-)*((.|\\n)*)${hasFileInfo ? "FILES:" : ""}`, "i");
const subtitleMatch = bdInfo.match(subtitleReg);
const audioReg = new RegExp(`AUDIO:(\\s|Codec|Bitrate|Description|Language|-)*((.|\\n)*)${subtitleMatch ? "(SUBTITLE(S)?)" : hasFileInfo ? "FILES:" : ""}`, "i");
const audioMatch = bdInfo.match(audioReg);
const fileSize = (_b = (_a = bdInfo.match(/Disc\s*Size:\s*((\d|,| )+)bytes/)) == null ? void 0 : _a[1]) == null ? void 0 : _b.replace(/,/g, "");
const quickSummaryStyle = !bdInfo.match(/PLAYLIST REPORT/i);
const videoPart = splitBDMediaInfo(videoMatch, 2);
const [mainVideo = "", otherVideo = ""] = videoPart;
const videoCodec = mainVideo.match(/2160/) ? "hevc" : "h264";
const hdrFormat = (_c = mainVideo.match(/\/\s*HDR(\d)*(\+)*\s*\//i)) == null ? void 0 : _c[0];
const isDV = !!otherVideo.match(/\/\s*Dolby\s*Vision\s*/i);
const audioPart = splitBDMediaInfo(audioMatch, 2);
const subtitlePart = splitBDMediaInfo(subtitleMatch, 3);
const resolution = (_d = mainVideo.match(/\d{3,4}(p|i)/)) == null ? void 0 : _d[0];
const {audioCodec = "", channelName = "", languageArray = []} = getBDAudioInfo(audioPart, quickSummaryStyle);
const subtitleLanguageArray = subtitlePart.map((item) => {
var _a2, _b2;
const quickStyleMatch = (_a2 = item.match(/(\w+)\s*\//)) == null ? void 0 : _a2[1];
const normalMatch = (_b2 = item.match(/Graphics\s*(\w+)\s*(\d|\.)+\s*kbps/i)) == null ? void 0 : _b2[1];
const language = quickSummaryStyle ? quickStyleMatch : normalMatch;
return language;
});
const mediaTags = getMediaTags(audioCodec, channelName, languageArray, subtitleLanguageArray, hdrFormat, isDV);
return {
fileSize,
videoCodec,
subtitles: subtitleLanguageArray,
audioCodec,
resolution,
mediaTags
};
};
var splitBDMediaInfo = (matchArray, matchIndex) => {
var _a, _b;
return (_b = (_a = matchArray == null ? void 0 : matchArray[matchIndex]) == null ? void 0 : _a.split("\n").filter((item) => !!item)) != null ? _b : [];
};
var getBDAudioInfo = (audioPart, quickSummaryStyle) => {
var _a, _b;
if (audioPart.length < 1) {
return {};
}
const sortArray = audioPart.sort((a, b) => {
var _a2, _b2;
const firstBitrate = parseInt((_a2 = a.match(/\/\s*(\d+)\s*kbps/i)) == null ? void 0 : _a2[1]);
const lastBitrate = parseInt((_b2 = b.match(/\/\s*(\d+)\s*kbps/i)) == null ? void 0 : _b2[1]);
return lastBitrate - firstBitrate;
});
const [mainAudio, secondAudio] = sortArray;
const mainAudioCodec = getAudioCodecFromTitle(mainAudio);
const secondAudioCodec = getAudioCodecFromTitle(secondAudio);
let audioCodec = mainAudioCodec;
let channelName = (_a = mainAudio.match(/\d\.\d/)) == null ? void 0 : _a[0];
if (mainAudioCodec === "lpcm" && secondAudioCodec === "dtshdma") {
audioCodec = secondAudioCodec;
channelName = (_b = mainAudio.match(/\d\.\d/)) == null ? void 0 : _b[0];
}
const languageArray = sortArray.map((item) => {
var _a2, _b2;
const quickStyleMatch = (_a2 = item.match(/(\w+)\s*\//)) == null ? void 0 : _a2[1];
const normalMatch = (_b2 = item.match(/Audio\s*(\w+)\s*\d+\s*kbps/)) == null ? void 0 : _b2[1];
const language = quickSummaryStyle ? quickStyleMatch : normalMatch;
return language;
});
return {
audioCodec,
channelName,
languageArray
};
};
var wrappingBBCodeTag = ({pre, post, tracker}, preTag, poTag) => {
const isPre = typeof pre !== "undefined" && pre !== null;
const isPost = typeof post !== "undefined" && post !== null;
if (isPre) {
pre.unshift(preTag);
}
if (isPost) {
post.push(poTag);
}
};
var getFilterBBCode = (content) => {
if (content) {
const bbCodes = htmlToBBCode(content);
return bbCodes.replace(/\[quote\]((.|\n)*?)\[\/quote\]/g, function(match, p1) {
if (p1 && p1.match(/温馨提示|郑重|PT站|网上搜集|本种子|商业盈利|商业用途|带宽|寬帶|法律责任|Quote:|正版|商用|注明|后果|负责/)) {
return "";
}
return match;
});
}
};
var rgb2hex = (rgb) => {
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
return rgb && rgb.length === 4 ? "#" + ("0" + parseInt(rgb[1], 10).toString(16)).slice(-2) + ("0" + parseInt(rgb[2], 10).toString(16)).slice(-2) + ("0" + parseInt(rgb[3], 10).toString(16)).slice(-2) : "";
};
var ensureProperColor = (color) => {
if (/rgba?/.test(color))
return rgb2hex(color);
return color;
};
var htmlToBBCode = (node) => {
const bbCodes = [];
const pre = [];
const post = [];
const pp = wrappingBBCodeTag.bind(null, {pre, post});
switch (node.nodeType) {
case 1: {
switch (node.tagName.toUpperCase()) {
case "SCRIPT": {
return "";
}
case "UL": {
pp(null, null);
break;
}
case "OL": {
pp("[list=1]", "[/list]");
break;
}
case "LI": {
const {className} = node;
if (CURRENT_SITE_INFO.siteType === "UNIT3D" && className) {
return `[quote]${node.textContent.trim()}[/quote]`;
} else {
pp("[*]", "\n");
break;
}
}
case "B": {
pp("[b]", "[/b]");
break;
}
case "U": {
pp("[u]", "[/u]");
break;
}
case "I": {
pp("[i]", "[/i]");
break;
}
case "DIV": {
const {className} = node;
if (className === "codemain") {
if (node.firstChild && node.firstChild.tagName === "PRE") {
pp("");
break;
} else {
pp("\n[quote]", "[/quote]");
break;
}
} else if (className === "hidden" && CURRENT_SITE_NAME === "HDT") {
pp("\n[quote]", "[/quote]");
break;
} else if (className.match("spoiler") && CURRENT_SITE_NAME === "KG") {
if (className === "spoiler-content") {
pp("\n[quote]", "[/quote]");
} else if (className === "spoiler-header") {
return "";
}
break;
} else if (className === "spoiler-text" && CURRENT_SITE_INFO.siteType === "AvistaZ") {
pp("\n[quote]", "[/quote]");
break;
} else if (className === "spoiler-toggle" && CURRENT_SITE_INFO.siteType === "AvistaZ") {
return "";
} else {
pp("\n", "\n");
break;
}
}
case "P": {
pp("\n");
break;
}
case "BR": {
if (CURRENT_SITE_INFO.siteType === "NexusPHP" && CURRENT_SITE_NAME !== "OurBits" || CURRENT_SITE_NAME.match(/^(UHDBits|HDBits|BTN)/)) {
pp("");
} else {
pp("\n");
}
break;
}
case "SPAN": {
pp(null, null);
break;
}
case "BLOCKQUOTE":
case "PRE":
case "FIELDSET": {
pp("[quote]", "[/quote]");
break;
}
case "CENTER": {
pp("[center]", "[/center]");
break;
}
case "TD": {
if (CURRENT_SITE_NAME.match(/^(TTG|HDBits|KG|HDSpace)/) || CURRENT_SITE_NAME === "HDT" || CURRENT_SITE_INFO.siteType === "UNIT3D") {
pp("[quote]", "[/quote]");
break;
} else {
return "";
}
}
case "IMG": {
let imgUrl = "";
const {src, title} = node;
const dataSrc = node.getAttribute("data-src") || node.getAttribute("data-echo");
if (title === ":m:") {
return ":m:";
}
if (dataSrc) {
imgUrl = dataSrc.match(/(http(s)?:)?\/\//) ? dataSrc : location.origin + "/" + dataSrc;
} else if (src && !src.match(/ico_\w+.gif|jinzhuan|thumbsup|kralimarko/)) {
imgUrl = src;
} else {
return "";
}
return `[img]${imgUrl}[/img]`;
}
case "FONT": {
const {color: color2, size} = node;
if (color2) {
pp(`[color=${ensureProperColor(color2)}]`, "[/color]");
}
if (size) {
pp(`[size=${size}]`, "[/size]");
}
break;
}
case "A": {
const {href, textContent} = node;
if (href && href.length > 0) {
if (CURRENT_SITE_NAME === "HDSpace") {
const div = $(node).find("div");
if (div[0] && div.attr("id")) {
const imgUrl = div.find("img").attr("src");
return `[url=${href}][img]${imgUrl}[/img][/url]`;
}
} else if (href.match(/javascript:void/) || textContent === "show" && CURRENT_SITE_NAME === "HDT") {
return "";
} else {
pp(`[url=${href}]`, "[/url]");
}
}
break;
}
case "H1": {
pp('[b][size="7"]', "[/size][/b]\n");
break;
}
case "H2": {
pp('[b][size="6"]', "[/size][/b]\n");
break;
}
case "H3": {
pp('[b][size="5"]', "[/size][/b]\n");
break;
}
case "H4": {
pp('[b][size="4"]', "[/size][/b]\n");
break;
}
}
const {textAlign, fontWeight, fontStyle, textDecoration, color} = node.style;
if (textAlign) {
switch (textAlign.toUpperCase()) {
case "LEFT": {
pp("[left]", "[/left]");
break;
}
case "RIGHT": {
pp("[right]", "[/right]");
break;
}
case "CENTER": {
pp("[center]", "[/center]");
break;
}
}
}
if (fontWeight === "bold" || ~~fontWeight >= 600) {
pp("[b]", "[/b]");
}
if (fontStyle === "italic")
pp("[i]", "[/i]");
if (textDecoration === "underline")
pp("[u]", "[/u]");
if (color && color.trim() !== "")
pp(`[color=${ensureProperColor(color)}]`, "[/color]");
break;
}
case 3: {
if (node.textContent.trim().match(/^(引用|Quote|代码|代碼|Show|Hide|Hidden text|Hidden content|\[show\])/)) {
return "";
}
return node.textContent;
}
default:
return null;
}
node.childNodes.forEach((node2, i) => {
const code = htmlToBBCode(node2);
if (code) {
bbCodes.push(code);
}
});
return pre.concat(bbCodes).concat(post).join("");
};
var getTagsFromSubtitle = (title) => {
const tags = {};
if (title.match(/diy/i)) {
tags.diy = true;
}
if (title.match(/国配|国语|普通话|国粤/i) && !title.match(/多国语言/)) {
tags.chinese_audio = true;
}
if (title.match(/Atmos|杜比全景声/i)) {
tags.dolby_atoms = true;
}
if (title.match(/HDR/i)) {
if (title.match(/HDR10\+/i)) {
tags.hdr10_plus = true;
} else {
tags.hdr = true;
}
}
if (title.match(/DoVi|(Dolby\s*Vision)|杜比视界/i)) {
tags.dolby_vision = true;
}
if (title.match(/粤/i)) {
tags.cantonese_audio = true;
}
if (title.match(/简繁|繁简|繁体|简体|中字|中英|中文/i)) {
tags.chinese_subtitle = true;
}
if (title.match(/Criterion|CC标准/i)) {
tags.the_criterion_collection = true;
}
return tags;
};
var getBDInfoOrMediaInfo = (bbcode) => {
var _a, _b, _c;
const quoteList = (_a = bbcode == null ? void 0 : bbcode.match(/\[quote\](.|\n)+?\[\/quote\]/g)) != null ? _a : [];
let bdinfo = "";
let mediaInfo = "";
quoteList.forEach((quote) => {
const quoteContent = quote.replace(/\[\/?quote\]/g, "").replace(/\u200D/g, "");
if (quoteContent.match(/Disc\s?Size|\.mpls/i)) {
bdinfo += quoteContent;
}
if (quoteContent.match(/(Unique\s*ID)|(Codec\s*ID)|(Stream\s*size)/i)) {
mediaInfo += quoteContent;
}
});
if (!bdinfo) {
bdinfo = (_c = (_b = bbcode.match(/Disc\s+(Info|Title|Label)[^[]+/i)) == null ? void 0 : _b[0]) != null ? _c : "";
}
return {
bdinfo,
mediaInfo
};
};
var replaceRegSymbols = (string) => {
return string.replace(/([*.?+$^[\](){}|\\/])/g, "\\$1");
};
var getRtIdFromTitle = async (title, tv, year) => {
var _a;
console.log(title, year);
const MAX_YEAR_DIFF = 2;
tv = tv || false;
year = parseInt(year) || 1800;
const url = `https://www.rottentomatoes.com/api/private/v2.0/search/?limit=2&q=${title}`;
const data = await fetch(url);
const movies = tv ? data.tvSeries : data.movies;
if (!Array.isArray(movies) || movies.length < 1) {
console.log("no search results");
return {};
}
const sorted = movies.concat();
if (year && sorted) {
sorted.sort((a, b) => {
if (Math.abs(a.year - year) !== Math.abs(b.year - year)) {
return Math.abs(a.year - year) - Math.abs(b.year - year);
} else {
return b.year - a.year;
}
});
}
let bestMatch, closeMatch;
for (const m of sorted) {
m.title = m.title || m.name;
if (m.title.toLowerCase() === title.toLowerCase()) {
bestMatch = bestMatch || m;
console.log("bestMatch", bestMatch);
} else if (m.title.toLowerCase().startsWith(title.toLowerCase())) {
closeMatch = closeMatch || m;
console.log("closeMatch", closeMatch);
}
if (bestMatch && closeMatch) {
break;
}
}
function yearComp(imdb, rt) {
return rt - imdb <= MAX_YEAR_DIFF && imdb - rt < MAX_YEAR_DIFF;
}
if (year && (!bestMatch || !yearComp(year, bestMatch.year))) {
if (closeMatch && yearComp(year, closeMatch.year)) {
bestMatch = closeMatch;
} else if (yearComp(year, sorted[0].year)) {
bestMatch = sorted[0];
}
}
bestMatch = bestMatch || closeMatch || movies[0];
if (bestMatch) {
const id = bestMatch && bestMatch.url.replace(/\/s\d{2}\/?$/, "");
const score = (_a = bestMatch == null ? void 0 : bestMatch.meterScore) != null ? _a : "0";
return {
id,
score
};
} else {
console.log("no match found on rt");
return {};
}
};
var showNotice = ({title = `${$t("\u63D0\u793A")}`, text = ""}) => {
const id = new Date().getTime();
const lastId = $(".easy-notification:last").attr("id");
if (lastId && id - lastId < 800) {
return;
}
const zIndex = parseInt($(".easy-notification:last").css("zIndex")) || 2e3;
let removeTimer = null;
const notificationDom = NOTIFICATION_TEMPLATE.replace("#title#", title).replace("#message#", text).replace("#id#", id).replace("#top#", 16).replace("#zIndex#", zIndex + 1);
$("body").append(notificationDom);
const offsetHeight = $(".easy-notification:last")[0].offsetHeight;
$(".easy-notification:last").prevAll(".easy-notification").each(function() {
const top = parseInt($(this).css("top"));
$(this).css("top", offsetHeight + top + 16 + "px");
});
$(".easy-notification:last").addClass("easy-notification-enter");
$(`#${id}`).find(".notification-close-btn").click(function() {
const offsetHeight2 = $(`#${id}`)[0].offsetHeight;
const nextDom = $(`#${id}`).prevAll(".easy-notification");
$(`#${id}`).remove();
nextDom.each(function() {
const top = parseInt($(this).css("top"));
$(this).css("top", top - offsetHeight2 + "px");
});
clearTimeout(removeTimer);
});
removeTimer = setTimeout(() => {
$(`#${id}`).remove();
clearTimeout(removeTimer);
}, 4e3);
};
var uploadToPtpImg = async (imgArray, isFiles = false) => {
try {
const apiKey = GM_getValue("easy-seed.ptp-img-api-key");
if (!apiKey) {
showNotice({
title: $t("ptpimg\u4E0A\u4F20\u5931\u8D25"),
text: $t("\u8BF7\u5230\u914D\u7F6E\u9762\u677F\u4E2D\u586B\u5165ptpimg\u7684api_key")
});
return;
}
let formData;
const options = {
method: "POST",
responseType: "json"
};
if (isFiles) {
formData = new FormData();
imgArray.forEach((img, index) => {
formData.append(`file-upload[${index}]`, img);
});
formData.append("api_key", apiKey);
} else {
formData = `link-upload=${imgArray.join("\n")}&api_key=${apiKey}`;
options.headers = {
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
};
}
options.data = formData;
const data = await fetch("https://ptpimg.me/upload.php", options);
if (!data) {
throw $t("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
}
let imgResultList = [];
if (data && data.length) {
imgResultList = data.map((img) => {
return `https://ptpimg.me/${img.code}.${img.ext}`;
});
return imgResultList;
} else {
throw $t("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
}
} catch (error) {
handleError(error);
}
};
var $t = (key) => {
var _a, _b;
const languageKey = USE_CHINESE ? "zh_CN" : "en_US";
return (_b = (_a = i18n_default[languageKey]) == null ? void 0 : _a[key]) != null ? _b : key;
};
var urlToFile = async (url) => {
var _a, _b;
const filename = (_b = (_a = url.match(/\/([^/]+)$/)) == null ? void 0 : _a[1]) != null ? _b : "filename";
const data = await fetch(url, {
responseType: "blob"
});
const file = new File([data], filename, {type: data.type});
return file;
};
var saveScreenshotsToPtpimg = async (imgArray) => {
try {
const isHdbHost = !!imgArray[0].match(/i\.hdbits\.org/);
const isPtpHost = !!imgArray[0].match(/ptpimg\.me/);
if (isPtpHost) {
throw $t("\u65E0\u9700\u8F6C\u5B58");
} else if (isHdbHost) {
const promiseArray = imgArray.map((item) => {
return urlToFile(item);
});
const fileArray = await Promise.all(promiseArray);
const data = uploadToPtpImg(fileArray, true);
return data;
} else {
const data = await uploadToPtpImg(imgArray);
return data;
}
} catch (error) {
handleError(error);
}
};
function fetch(url, options = {}) {
return new Promise((resolve, reject) => {
GM_xmlhttpRequest(__assign(__assign({
method: "GET",
url,
responseType: "json"
}, options), {
onload: (res) => {
const {statusText, status, response} = res;
if (status !== 200) {
reject(new Error(statusText || status));
} else {
resolve(response);
}
},
ontimeout: () => {
reject(new Error("timeout"));
},
onerror: (error) => {
reject(error);
}
}));
});
}
// src/target/common.js
var getScreenshotsBBCode = (imgArray) => {
return imgArray.map((img) => {
if (img.match(/\[url=.+\]/i)) {
return img;
}
return `[img]${img}[/img]`;
});
};
var getTeamName = (info) => {
var _a, _b, _c;
const teamMatch = info.title.match(/-([^-]+)$/);
let teamName = (_c = (_b = (_a = teamMatch == null ? void 0 : teamMatch[1]) == null ? void 0 : _a.replace(/-/g, "")) == null ? void 0 : _b.split("@")) != null ? _c : "";
if (teamName) {
teamName = teamName.length > 1 ? teamName[1] : teamName[0];
} else {
teamName = "other";
}
return teamName;
};
// src/target/its.js
var its_default = async (info) => {
var _a, _b, _c, _d, _e, _f, _g;
let template = `[center]
[img]$poster$[/img]
[url=$imdbUrl$][img]https://i.ibb.co/KD855ZM/IMDb-Logo-2016.png[/img][/url][size=3]$imdbScore$[/size][*][url=$rtUrl$][img]https://i.ibb.co/BwtmdcV/rottentomatoes-logo.png[/img][/url][size=3]$rtScore$[/size][*][size=3][url=$tmdbUrl$][img]https://i.ibb.co/HhgF1gC/tmdb-logo.png[/img][/url]$tmdbScore$[/size]
[color=DarkOrange][size=2]\u25E2 SYNOPSIS \u25E3[/size][/color]
$synopsis$
[color=DarkOrange][size=2]\u25E2 TRAILER \u25E3[/size][/color]
[youtube]$youtubeUrl$[/youtube]
[color=DarkOrange][size=2]\u25E2 SCREENSHOTS \u25E3[/size][/color]
[box][hide]$SCREENSHOTS$[/hide][/box]
[/center]`;
const collectionMap = {};
$('select[name="collection_id1"] option').each(function() {
const option = $(this);
collectionMap[option.text()] = option.val();
});
const collectionValueArr = [];
const teamName = getTeamName(info);
if (collectionMap[teamName]) {
collectionValueArr.push(collectionMap[teamName]);
}
const {imdbUrl, category, screenshots, comparisons = [], resolution, movieName} = info;
if (!resolution.match(/2160|1080|720/) && category === "movie") {
$('select[name="type"]').val("67");
}
const screenshotsBBCode = getScreenshotsBBCode(screenshots);
template = template.replace("$SCREENSHOTS$", screenshotsBBCode.join("\n"));
const comparisonImgs = comparisons.flatMap((v) => v.imgs);
if (comparisonImgs.length > 0) {
const comparisonImgsBBCode = getScreenshotsBBCode(comparisonImgs);
template = template.replace(/(\[\/center\])$/, `[color=DarkOrange][size=2]\u25E2 COMPARISONS \u25E3[/size][/color]
[box][hide]${comparisonImgsBBCode.join(" ")}[/hide][/box]
$1`);
}
if (category.match(/tv|movie|cartoon|documentary/)) {
$('textarea[name="descr"]').val($t("\u6570\u636E\u52A0\u8F7D\u4E2D..."));
try {
const replaceParams = {
tmdbUrl: "",
tmdbScore: 0,
imdbScore: 0,
imdbUrl,
poster: "",
synopsis: "",
rtUrl: "",
rtScore: 0,
youtubeUrl: ""
};
const {poster = "", imdb_rating_average: imdbRate = 0, description = "", year, aka, directors = [], details = {}} = await getIMDBData(imdbUrl);
let language = details.Language || "";
language = (_c = (_b = (_a = language == null ? void 0 : language.split("|")) == null ? void 0 : _a[0]) == null ? void 0 : _b.trim()) != null ? _c : "";
const director = directors.map((item) => item.name)[0];
if (collectionMap[director]) {
collectionValueArr.push(collectionMap[director]);
}
if (collectionMap[language]) {
collectionValueArr.push(collectionMap[language]);
}
collectionValueArr.forEach((value, index) => {
$(`select[name="collection_id${index + 1}"]`).val(value);
});
replaceParams.poster = poster;
replaceParams.synopsis = description;
replaceParams.imdbScore = imdbRate;
const imdbId = getIMDBIdByUrl(imdbUrl);
const {id: tmdbId, vote_average: tmdbRate} = await getTMDBIdByIMDBId(imdbId, {
append_to_response: "videos"
});
if (tmdbId) {
replaceParams.tmdbUrl = `https://www.themoviedb.org/movie/${tmdbId}`;
replaceParams.tmdbScore = tmdbRate;
const videos = await getTMDBVideos(tmdbId);
const youtubeId = (_f = (_e = (_d = videos.filter((video) => video.site === "YouTube")) == null ? void 0 : _d[0]) == null ? void 0 : _e.key) != null ? _f : "";
if (youtubeId.length > 0) {
replaceParams.youtubeUrl = `https://www.youtube.com/watch?v=${youtubeId}`;
}
}
const searchMovieName = movieName || ((_g = aka.filter((item) => item.country.match(/(World-wide)|UK|USA/))) == null ? void 0 : _g[0].title);
const rtInfo = await getRtIdFromTitle(searchMovieName, !!category.match(/tv/), year);
const {score = 0, id = ""} = rtInfo;
replaceParams.rtScore = `${score}%`;
replaceParams.rtUrl = `https://www.rottentomatoes.com/${id}`;
const ptpImgApiKey = GM_getValue("easy-seed.ptp-img-api-key") || "";
if (ptpImgApiKey) {
const ptpImgPoster = await uploadToPtpImg([poster]);
replaceParams.poster = ptpImgPoster || "";
}
Object.keys(replaceParams).forEach((key) => {
template = template.replace(`$${key}$`, replaceParams[key]);
});
$('textarea[name="descr"]').val(template);
} catch (error) {
$('textarea[name="descr"]').val(error.message);
}
}
};
// src/target/tjupt.js
var tjupt_default = (info) => {
const domTimeout = setTimeout(() => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
if ($("#ename")) {
const {title, description, doubanInfo, category, resolution} = info;
$("#ename").val(title);
const fullDescription = description + doubanInfo;
let area = (_b = (_a = fullDescription.match(/(产\s+地|国\s+家)\s+(.+)/)) == null ? void 0 : _a[2]) != null ? _b : "";
area = area.replace(/\[\/?.+?\]/g, "");
const originalName = (_d = (_c = fullDescription.match(/(片\s+名)\s+(.+)?/)) == null ? void 0 : _c[2]) != null ? _d : "";
const translateName = (_h = (_g = (_f = (_e = fullDescription.match(/(译\s+名)\s+(.+)/)) == null ? void 0 : _e[2]) == null ? void 0 : _f.split("/")) == null ? void 0 : _g[0]) != null ? _h : "";
const castArray = (_l = (_k = (_j = (_i = fullDescription.match(/(主\s+演)\s+([^◎]+)/)) == null ? void 0 : _i[2]) == null ? void 0 : _j.split("\n")) == null ? void 0 : _k.filter((item) => !!item)) != null ? _l : [];
const language = (_n = (_m = fullDescription.match(/(语\s+言)\s+(.+)/)) == null ? void 0 : _m[2]) != null ? _n : "";
const castStr = castArray.map((item) => {
var _a2;
return (_a2 = item.trim().split(/\s+/)) == null ? void 0 : _a2[0];
}).join("/");
if (area) {
if (category === "movie") {
$("#district").val(area.replace(/,/g, "/").replace(/中国/, ""));
} else if (category.match(/tv/)) {
let selector = "";
if (area.match(/大陆/)) {
selector = "#specificcat1";
} else if (area.match(/台|港/)) {
selector = "#specificcat2";
} else if (area.match(/美国/)) {
selector = "#specificcat3";
} else if (area.match(/英国/)) {
selector = "#specificcat7";
} else if (area.match(/日本/)) {
selector = "#specificcat4";
} else if (area.match(/韩国/)) {
selector = "#specificcat5";
} else {
selector = "#specificcat6";
}
$(selector).attr("checked", true);
getcheckboxvalue("specificcat");
} else if (category.match(/variety/)) {
const districtMap = {
CN: "#district1",
HK: "#district2",
TW: "#district2",
JP: "#district4",
KR: "#district4",
US: "#district3",
EU: "#district3",
OT: "#district5"
};
$(districtMap[info.area]).attr("checked", true);
getcheckboxvalue("district");
}
}
if ($("#format")) {
if (category.match(/variety/)) {
if (resolution.match(/720/)) {
$("#format3").attr("checked", true);
} else if (resolution.match(/1080/)) {
$("#format5").attr("checked", true);
}
getcheckboxvalue("format");
} else if (category.match(/documentary/)) {
if (resolution.match(/720/)) {
$("#format2").attr("checked", true);
} else if (resolution.match(/1080/)) {
$("#format1").attr("checked", true);
}
getradiovalue("format");
}
}
if ($("#language")) {
let selector = "";
if (language) {
if (language.match(/汉语/)) {
selector = "#language1";
} else if (language.match(/粤/)) {
selector = "#language2";
} else if (language.match(/英语/)) {
selector = "#language3";
} else if (language.match(/日语/)) {
selector = "#language4";
} else if (language.match(/韩语/)) {
selector = "#language5";
}
$(selector).attr("checked", true);
getcheckboxvalue("language");
}
}
if (category.match(/variety/)) {
$("#tvshowsguest").val(castStr);
}
let chineseName = originalName;
if (!originalName.match(/[\u4e00-\u9fa5]+/)) {
chineseName = translateName.match(/[\u4e00-\u9fa5]+/) ? translateName : "";
}
$("#cname").val(chineseName);
clearTimeout(domTimeout);
}
}, 2e3);
};
// src/target/hdr.js
var hdr_default = (info) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
const {description, doubanInfo} = info;
const fullDescription = description + doubanInfo;
const imdbRank = (_b = (_a = fullDescription.match(/IMDb评分\s+(\d(\.\d)?)/i)) == null ? void 0 : _a[1]) != null ? _b : "";
$("#upload-imdb").val(imdbRank);
const originalName = (_d = (_c = fullDescription.match(/(片\s+名)\s+(.+)?/)) == null ? void 0 : _c[2]) != null ? _d : "";
const translateName = (_h = (_g = (_f = (_e = fullDescription.match(/(译\s+名)\s+(.+)/)) == null ? void 0 : _e[2]) == null ? void 0 : _f.split("/")) == null ? void 0 : _g[0]) != null ? _h : "";
const summary = (_l = (_k = (_j = (_i = fullDescription.match(/(简\s+介)\s+([^[◎]+)/)) == null ? void 0 : _i[2]) == null ? void 0 : _j.split("/")) == null ? void 0 : _k[0]) != null ? _l : "";
let chineseName = originalName;
if (!originalName.match(/[\u4e00-\u9fa5]+/)) {
chineseName = translateName.match(/[\u4e00-\u9fa5]+/) ? translateName : originalName;
}
$("#title_chs").val(chineseName);
$("#upload_introduction").val(summary);
};
// src/target/bib.js
var bib_default = (info) => {
const {year, pager, translator, author, publisher, ISBN, book_intro} = info.doubanBookInfo;
$("#AuthorsField").val(author.join(","));
$("#PublishersField").val(publisher);
$("#IsbnField").val(ISBN);
$("#YearField").val(year);
$("#PagesField").val(pager);
$("#LanguageField").val("17");
$("#inputFileID").replaceWith('');
$("#TranslatorsField").val(translator.join(","));
$("#DescriptionField").val(book_intro);
const event = new Event("change");
document.getElementById("DescriptionField").dispatchEvent(event);
};
// src/target/bB.js
var bB_default = (info) => {
const {
title,
category,
imdbUrl,
formDom,
tags,
source,
screenshots,
mediaInfo,
videoType
} = info;
const {category: categoryConfig} = CURRENT_SITE_INFO;
$(categoryConfig.selector).attr("onchange", "").val(categoryConfig.map[category]);
$("#dynamic_form").html(formDom);
const isBluray = videoType.match(/bluray/i);
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {format = "", subtitles = []} = getInfoFunc(mediaInfo);
info.source = getSource(source, title);
info.format = getFormat(format, videoType);
const tvTitleArray = [];
["source", "videoCodec", "audioCodec", "format", "resolution", "mediaInfo"].forEach((key) => {
const {selector = "", map} = CURRENT_SITE_INFO[key];
if (map) {
const mapValue = map[info[key]];
$(selector).val(mapValue);
tvTitleArray.push(mapValue);
} else {
$(selector).val(info[key]);
}
});
if (imdbUrl) {
getIMDBData(imdbUrl).then((imdbData) => {
var _a, _b, _c;
let {name, year, genre, directors = [], actors = [], description, poster, details, aka} = imdbData;
let movieTitle = name;
const akaName = details["Also Known As"];
const originalTitle = (_b = (_a = aka.filter((item) => {
return item.country === "(original title)";
})) == null ? void 0 : _a[0]) == null ? void 0 : _b.title;
if (akaName && originalTitle !== movieTitle) {
movieTitle += ` AKA ${akaName}`;
}
if (category.match(/tv/i)) {
let seasonEpisode = (_c = title.match(/S\d+(E\d+)?/i)) == null ? void 0 : _c[0];
if (seasonEpisode) {
seasonEpisode = seasonEpisode.toUpperCase().replace(/S0?(\d+)$/, "Season $1");
movieTitle += ` ${seasonEpisode} `;
}
movieTitle += `[${tvTitleArray.join(" / ")}]`;
}
$(CURRENT_SITE_INFO.name.selector).val(movieTitle);
$(CURRENT_SITE_INFO.year.selector).val(year);
if (Array.isArray(genre)) {
genre = genre.join(",");
}
const castTag = [...directors, ...actors].map((item) => {
return item.name.replace(/\s/g, ".").toLowerCase();
});
$("#tags").val(`${genre},${castTag.join(",")}`);
$("#desc").val(`${imdbUrl}
${description}`);
uploadToPtpImg([poster]).then((img) => {
$(CURRENT_SITE_INFO.poster.selector).val(img[0]);
}).catch((error) => {
showNotice({text: error.message || $t("\u5C01\u9762\u4E0A\u4F20\u5931\u8D25")});
});
}).catch((error) => {
console.log(error);
});
}
if (category !== "movie") {
return;
}
const releaseInfo = [];
if (videoType === "remux") {
releaseInfo.push("REMUX");
}
if (title.match(/Commentary/i)) {
releaseInfo.push("w. Commentary");
}
if (subtitles.length > 0) {
releaseInfo.push("w. Subtitles");
}
if (tags.hdr) {
releaseInfo.push("HDR");
}
$('input[name="remaster_title"]').val(releaseInfo.join(" / "));
screenshots.forEach((img, index) => {
index++;
let inputDom = $(`input[name='screenshot${index}']`);
if (inputDom[0]) {
inputDom.val(img);
} else if (index <= 4 && !inputDom[0]) {
add_screenshot();
inputDom = $(`input[name='screenshot${index}']`);
inputDom.val(img);
}
});
};
var getSource = (source, title) => {
if (title.match(/webrip/i)) {
return "webrip";
} else if (title.match(/dvd5/i)) {
return "dvd5";
} else if (title.match(/dvd9/i)) {
return "dvd9";
} else if (title.match(/3D/) && source.match(/bluray/i)) {
return "bluray3d";
}
return source;
};
var getFormat = (format, videoType) => {
if (videoType.match(/bluray/)) {
format = "m2ts";
} else if (videoType.match(/dvd/)) {
format = "vob";
}
return format || "mkv";
};
// src/target/ptp.js
var ptp_default = (info) => {
const {
title,
imdbUrl,
tags,
size,
videoCodec,
videoType,
resolution
} = info;
const groupId = getUrlParam("groupid");
if (!groupId) {
$(CURRENT_SITE_INFO.imdb.selector).val(imdbUrl || 0);
AutoFill();
}
info.resolution = getResolution2(resolution, videoType, title);
info.videoCodec = getVideoCodec(videoCodec, videoType, size);
["category", "source", "videoCodec", "resolution"].forEach((key) => {
const {selector = "", map} = CURRENT_SITE_INFO[key];
if (map) {
const mapValue = map[info[key]];
$(selector).val(mapValue);
} else {
$(selector).val(info[key]);
}
});
const description = getDescription(info);
$(CURRENT_SITE_INFO.description.selector).val(description);
const editionInfo = getEditionInfo(videoType, tags);
if (editionInfo.length > 0) {
$("#remaster").attr("checked", true);
Remaster();
editionInfo.forEach((edition) => {
const event = new Event("click");
$(`#remaster_tags a:contains("${edition}")`)[0].dispatchEvent(event);
});
}
};
var getEditionInfo = (videoType, tags) => {
const editionInfo = [];
if (videoType === "remux") {
editionInfo.push("Remux");
}
if (tags.hdr) {
editionInfo.push("HDR10");
}
if (tags.hdr10_plus) {
editionInfo.push("HDR10+");
}
if (tags.dolby_vision) {
editionInfo.push("Dolby Vision");
}
if (tags.dolby_atmos) {
editionInfo.push("Dolby Atmos");
}
if (tags.dts_x) {
editionInfo.push("DTS:X");
}
return editionInfo;
};
var getVideoCodec = (videoCodec, videoType, size) => {
if (videoType === "bluray") {
return getBDType(size);
} else if (videoType === "dvd") {
const GBSize = size / 1e9;
if (GBSize < 5) {
return "DVD5";
} else {
return "DVD9";
}
}
return videoCodec;
};
var getResolution2 = (resolution, videoType, title) => {
if (videoType === "DVD" && title.match(/NTSC/i)) {
return "NTSC";
} else if (videoType === "DVD" && title.match(/PAL/i)) {
return "PAL";
}
return resolution;
};
var getDescription = (info) => {
const {description, mediaInfo} = info;
let filterDescription = "";
if (mediaInfo) {
filterDescription += `[mediainfo]${mediaInfo}[/mediainfo]`;
}
let screenshots = getScreenshotsFromBBCode(description);
screenshots = screenshots.map((item) => `[img]${item}[/img]`);
return filterDescription + "\n" + screenshots.join("\n");
};
// src/target/ptn.js
var ptn_default = (info) => {
const {resolution, videoType, source} = info;
let format = "";
const formatMap = {
remux: "Remux",
web: "WebRip",
dvd: "DVDR",
dvdrip: "DVDRip",
"720p": "720P",
"1080p": "1080P",
"2160p": "2160P"
};
if (videoType.match(/bluray/)) {
format = "BluRay";
} else if (videoType === "encode" && source === "bluray") {
format = formatMap[resolution];
} else {
format = formatMap[videoType] || "";
}
$("#format").val(format);
};
// src/target/gpw.js
var gpw_default = async (info) => {
const site = CURRENT_SITE_INFO;
const isUploadSuccess = !$("#mediainfo")[0];
if (isUploadSuccess) {
return;
}
transformInfo(info);
const isAddFormat = getUrlParam("groupid");
if (!isAddFormat) {
$(site.imdb.selector).val(info.imdbUrl || 0);
$("#imdb_button").click();
$("#upload .collapse").show();
}
$(site.category.selector).val(site.category.map[info.category]);
fillEditionInfo(info);
fillMediaInfo(info);
if (!$(site.source.selector).val()) {
handleNoAutoCheck(info);
}
fillScene(info);
fillProcessing(info);
fillDescription(info);
document.querySelector("#description-container .bbcode-preview-button").click();
};
function buildDescription(info) {
let description = "";
if (info.comparisons.length > 0) {
for (const comparison of info.comparisons) {
description += `${comparison.reason}[comparison=${comparison.title}]
${comparison.imgs.join("\n")}
[/comparison]
`;
}
}
if (info.screenshots.length > 0) {
description += info.screenshots.map((v) => `[img]${v}[/img]`).join("\n") + "\n\n";
}
return description.trim();
}
function fillEditionInfo(info) {
const site = CURRENT_SITE_INFO;
const editionTags = Object.keys(info.tags).map((tag) => site.targetInfo.editionTags[tag]).filter(Boolean);
let otherTag;
if (Object.keys(info.otherTags).length > 0) {
otherTag = Object.keys(info.otherTags).join(", ");
}
if (editionTags.length > 0 || otherTag) {
$("#movie_edition_information").click();
}
if (editionTags.length > 0) {
for (const tag of editionTags) {
$(`#movie_remaster_tags a[onclick*="'${tag}'"]`).click();
}
}
if (otherTag) {
$("#other-button").click();
$("[name=remaster_custom_title]").val(otherTag);
}
}
function buildPTPDescription(info) {
let text = info.originalDescription;
text = text.replaceAll("http://ptpimg.me", "https://ptpimg.me");
for (const mediainfo of info.mediaInfos) {
text = text.replace(mediainfo, "");
}
text = text.replaceAll(/\[(mediainfo|bdinfo)\][\s\S]*?\[\/(mediainfo|bdinfo)\]/gi, "");
text = text.replaceAll(/^(?!\[img\])https:\/\/ptpimg.me.*?png(?!\[\/img\])$/gim, (imgUrl) => {
return `[img]${imgUrl}[/img]`;
});
text = text.replaceAll(/\[comparison.*\][\s\S]*\[\/comparison\]/gi, (comparisonText) => {
return comparisonText.replaceAll("[img]", "").replaceAll("[/img]", "").split("https://ptpimg.me").join("\nhttps://ptpimg.me").replaceAll(/\s*\n\s*/g, "\n");
});
text = text.replaceAll(/\[hide(.*)?\]\s*\[url=https:\/\/ptpimg.me.*?png\]\[img\][\s\S]*?\[\/hide\]/gi, (imgText) => {
var _a;
const imgs = [];
for (const urlMatch of imgText.matchAll(/\[url=(.*?)\]/ig)) {
imgs.push(urlMatch[1]);
}
const rawTitle = ((_a = imgText.match(/^\[hide=(.*?)\]/)) == null ? void 0 : _a[1]) || "";
const comparisonTitles = rawTitle.trim().split(/\||\/|,|vs\.?| - /i).map((v) => v.trim());
if (comparisonTitles.length >= 2) {
return `[comparison=${comparisonTitles.join(", ")}]
${imgs.join("\n")}
[/comparison]
`;
} else {
const hideTitle = rawTitle ? `=${rawTitle}` : "";
return `[hide${hideTitle}]
[img]${imgs.join("[/img]\n[img]")}[/img]
[/hide]
`;
}
});
text = text + "\n\n";
text = text.replaceAll(/\[url=https:\/\/ptpimg.me.*?png\]\[img\][\s\S]*?\n\n/gi, (imgText) => {
const imgs = [];
for (const urlMatch of imgText.matchAll(/\[url=(.*?)\]/ig)) {
imgs.push(urlMatch[1]);
}
return `[hide]
[img]${imgs.join("[/img]\n[img]")}[/img]
[/hide]
`;
});
text = text.replaceAll(/\n\s*\n/g, "\n\n");
return text.trim();
}
function fillMediaInfo(info) {
for (let i = 1; i < info.mediaInfos.length; i++) {
$("#add-mediainfo")[0].click();
}
const textareas = Array.from($('[name="mediainfo[]"]'));
for (const [index, textarea] of textareas.entries()) {
textarea.value = info.mediaInfos[index];
textarea.dispatchEvent(new Event("input"));
}
;
$('[name="mediainfo[]"]')[0].dispatchEvent(new Event("change"));
}
function fillScene(info) {
if (info.tags.scene) {
$("#scene").prop("checked", true);
}
}
function fillProcessing(info) {
let {videoType, size, source, tags} = info;
if (source.match(/bluray|hddvd|dvd/)) {
if (tags.diy) {
videoType = "DIY";
}
const videoTypeConfig = CURRENT_SITE_INFO.videoType;
const {selector, map} = videoTypeConfig;
$(selector).val(map[videoType]);
$(selector)[0].dispatchEvent(new Event("change"));
if (map[videoType] === "Untouched") {
const bdType = getBDType(size);
$('select[name="processing_other"]').val(bdType);
}
$(selector)[0].dispatchEvent(new Event("input"));
}
}
function handleNoAutoCheck(info) {
const {
mediaInfo,
videoType
} = info;
const isBluray = videoType.match(/bluray/i);
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {format = "", subtitles = []} = getInfoFunc(mediaInfo);
info.format = getFormat2(format, videoType);
["source", "videoCodec", "format", "resolution"].forEach((key) => {
const {selector = "", map} = CURRENT_SITE_INFO[key];
if (map) {
const mapValue = map[info[key]];
$(selector).val(mapValue);
if (key === "videoCodec" && mapValue === "Other") {
document.querySelector(selector).dispatchEvent(new Event("change"));
$('input[name="codec_other"]').val(info[key].toUpperCase());
}
} else {
$(selector).val(info[key]);
}
});
if (subtitles.length > 0) {
$("#mixed_subtitles").attr("checked", true);
$('input[name="subtitles[]"][type="checkbox"]').each(function() {
const language = $(this).attr("id").replace(/^\S|(_\S)/g, (letter) => letter.replace("_", " ").toUpperCase());
if (subtitles.includes(language)) {
$(this).attr("checked", true);
}
});
const event = new Event("change");
document.querySelector("#mixed_subtitles").dispatchEvent(event);
const chineseLanguages = subtitles.filter((item) => item.match(/Chinese|Traditional|Simplified/i));
if (chineseLanguages.length === 1 && chineseLanguages[0] === "Chinese") {
const selector = chineseLanguages[0].match(/Traditional/i) ? "#chinese_traditional" : "#chinese_simplified";
$(selector).attr("checked", true);
} else if (chineseLanguages.length >= 2) {
$("#chinese_traditional,#chinese_simplified").attr("checked", true);
}
}
}
var getFormat2 = (format, videoType) => {
if (videoType.match(/bluray/) && format !== "iso") {
format = "m2ts";
} else if (videoType.match(/dvd/)) {
format = "vob";
}
return format || "mkv";
};
function transformInfo(info) {
if (info.mediaInfos.length === 0 && info.mediaInfo) {
info.mediaInfos = [info.mediaInfo];
}
if (["encode", "remux"].includes(info.videoType)) {
const newMediaInfos = [];
for (const mediaInfo of info.mediaInfos) {
if (mediaInfo.match(/Disc Title|Disc Label/i)) {
continue;
}
newMediaInfos.push(mediaInfo);
}
info.mediaInfos = newMediaInfos;
}
}
function fillDescription(info) {
const site = CURRENT_SITE_INFO;
let description;
if (info.sourceSite === "PTP") {
description = buildPTPDescription(info);
} else if (info.sourceSite === "BeyondHD") {
description = info.originalDescription;
} else {
description = buildDescription(info);
}
$(site.description.selector).val(description);
$(site.description.selector)[0].dispatchEvent(new Event("input"));
}
// src/target/index.js
var fillTargetForm = (info) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
console.log(info);
if (CURRENT_SITE_NAME === "bB") {
bB_default(info);
return false;
}
if (CURRENT_SITE_NAME === "PTP") {
ptp_default(info);
return false;
}
if (CURRENT_SITE_NAME === "GPW") {
gpw_default(info);
return false;
}
if (CURRENT_SITE_NAME === "PTSBAO" && localStorage.getItem("autosave")) {
localStorage.removeItem("autosave");
}
const imdbId = getIMDBIdByUrl(info.imdbUrl);
const isBluray = info.videoType.match(/bluray/i);
const {screenshots = []} = info;
const imdbSelector = (_a = CURRENT_SITE_INFO.imdb) == null ? void 0 : _a.selector;
if (CURRENT_SITE_NAME.match(/HDRoute|HDSpace/)) {
$(imdbSelector).val((_b = imdbId == null ? void 0 : imdbId.replace("tt", "")) != null ? _b : "");
} else {
if (imdbSelector) {
$(imdbSelector).val(info.imdbUrl);
}
}
if (CURRENT_SITE_NAME === "HDBits") {
let mediaTitle = info.title.replace(/([^\d]+)\s+([12][90]\d{2})/, (match, p1, p2) => {
return `${info.movieName || info.movieAkaName} ${p2}`;
});
if (info.videoType === "remux") {
mediaTitle = mediaTitle.replace(/\s+(bluray|blu-ray)/ig, "");
}
info.title = mediaTitle;
}
if (CURRENT_SITE_INFO.name) {
const {title, subtitle} = info;
let torrentTitle = title;
if (CURRENT_SITE_NAME === "TTG") {
torrentTitle += `[${subtitle}]`;
} else if (CURRENT_SITE_NAME.match(/SSD|iTS/)) {
torrentTitle = title.replace(/\s/ig, ".");
}
$(CURRENT_SITE_INFO.name.selector).val(torrentTitle);
}
disableTorrentChange();
const commonInfoKeys = ["subtitle", "douban", "area", "audioCodec"];
commonInfoKeys.forEach((key) => {
const siteInfo = CURRENT_SITE_INFO[key];
if (siteInfo && siteInfo.selector) {
let value = info[key];
if (key === "douban") {
value = info.doubanUrl;
} else if (key === "area" || key === "audioCodec") {
value = siteInfo.map[info[key]];
}
$(siteInfo.selector).val(value);
}
});
const mediaInfo = info.mediaInfo;
let description = "";
if (info.description) {
description = info.description.replace(/^(\s+)/g, "");
if (isChineseTacker(CURRENT_SITE_INFO.siteType) && CURRENT_SITE_NAME !== "SSD") {
const {doubanInfo} = info;
if (doubanInfo) {
description = doubanInfo + "\n" + description;
}
} else {
const {sourceSiteType} = info;
if (isChineseTacker(sourceSiteType) && CURRENT_SITE_NAME !== "Bib") {
description = filterNexusDescription(info);
}
}
}
if (CURRENT_SITE_INFO.mediaInfo) {
if (!(isBluray && CURRENT_SITE_NAME.match(/^(HDBits|Blutopia|HaresClub)/))) {
$(CURRENT_SITE_INFO.mediaInfo.selector).val(mediaInfo);
description = description.replace(mediaInfo.trim(), "");
}
}
if (CURRENT_SITE_INFO.screenshots) {
screenshots.forEach((img) => {
if (description.includes(img)) {
description = description.replace(img, "");
if (!img.match(/\[url=.+?\[url]/)) {
description = description.replace(/\[img\]\[\/img\]\n*/g, "");
}
}
});
}
if (CURRENT_SITE_NAME === "SSD") {
$(CURRENT_SITE_INFO.imdb.selector).val(info.doubanUrl || info.imdbUrl);
$(CURRENT_SITE_INFO.screenshots.selector).val(screenshots.join("\n"));
if (info.category === "tvPack" || info.title.match(/Trilogy|Collection/i) || info.subTitle && info.subTitle.match(/合集/)) {
$('input[name="pack"]').attr("checked", true);
}
}
if (CURRENT_SITE_NAME === "HDAI") {
$(CURRENT_SITE_INFO.imdb.selector).val(info.doubanUrl || info.imdbUrl);
$(CURRENT_SITE_INFO.screenshots.selector).val(screenshots.join("\n"));
if (isBluray) {
$('input[type="checkbox"][name="tag[o]"]').attr("checked", true);
}
}
if (CURRENT_SITE_INFO.poster) {
let poster = info.poster;
if (!poster) {
const doubanPosterImage = (info.description + info.doubanInfo).match(/\[img\](http[^[]+?(poster|(img\d\.doubanio))[^[]+?)\[\/img\]/);
if (doubanPosterImage && doubanPosterImage[1]) {
poster = doubanPosterImage[1];
} else {
poster = (_d = (_c = description.match(/\[img\](.+?)\[\/img\]/)) == null ? void 0 : _c[1]) != null ? _d : "";
}
}
if (poster) {
$(CURRENT_SITE_INFO.poster).val(poster);
if (CURRENT_SITE_NAME === "HDRoute") {
$('input[name="poster"]').val(poster);
description = description.replace(poster, "");
}
}
}
if (CURRENT_SITE_NAME === "BeyondHD") {
info.screenshots.forEach((img) => {
const regStr = new RegExp(`\\[img\\](${img})\\[\\/img\\]`);
if (description.match(regStr)) {
description = description.replace(regStr, function(p1, p2) {
return `[url=${p2}][img=350x350]${p2}[/img][/url]`;
});
}
});
}
description = filterEmptyTags(description);
if (CURRENT_SITE_NAME === "PTer") {
const {mediaInfo: mediaInfo2, bdinfo} = getBDInfoOrMediaInfo(description);
description = description.replace(`[quote]${mediaInfo2}[/quote]`, `[hide=mediainfo]${mediaInfo2}[/hide]`);
description = description.replace(`[quote]${bdinfo}[/quote]`, `[hide=BDInfo]${bdinfo}[/hide]`);
}
if (CURRENT_SITE_NAME === "PTN") {
description = info.imdbUrl + "\n\n" + description;
}
const thanksQuoteClosed = GM_getValue("easy-seed.thanks-quote-closed") || "";
if (!thanksQuoteClosed) {
description = getThanksQuote(info) + description.trim();
}
$(CURRENT_SITE_INFO.description.selector).val(description);
if (CURRENT_SITE_NAME.match(/BeyondHD|Blutopia|HDPOST|ACM|Aither/)) {
const fillIMDBId = CURRENT_SITE_INFO.siteType === "UNIT3D" ? imdbId.replace("tt", "") : imdbId;
$(CURRENT_SITE_INFO.imdb.selector).val(fillIMDBId);
getTMDBIdByIMDBId(imdbId).then((data) => {
$(CURRENT_SITE_INFO.tmdb.selector).val(data.id);
});
if (CURRENT_SITE_NAME.match(/BeyondHD|ACM/i)) {
const {category, videoType} = info;
info.category = videoType;
info.videoType = category;
if (isBluray) {
let bdType = getBDType(info.size);
if (videoType === "uhdbluray" && bdType === "BD50") {
bdType = "uhd50";
}
info.category = bdType;
}
}
}
if (CURRENT_SITE_INFO.category) {
const category = CURRENT_SITE_INFO.category.map[info.category];
const keyArray = ["videoCodec", "videoType", "resolution", "source", "area"];
let finalSelectArray = [];
if (Array.isArray(category)) {
finalSelectArray = [...category];
keyArray.forEach((key) => {
finalSelectArray = matchSelectForm(CURRENT_SITE_INFO, info, key, finalSelectArray);
if (finalSelectArray.length === 1) {
$(CURRENT_SITE_INFO.category.selector).val(finalSelectArray[0]);
}
});
} else {
[...keyArray, "category"].forEach((key) => {
matchSelectForm(CURRENT_SITE_INFO, info, key, finalSelectArray);
});
}
}
if (CURRENT_SITE_INFO.format) {
const formatData = CURRENT_SITE_INFO.format;
$(formatData.selector).val(formatData.map[info.format]);
}
if (CURRENT_SITE_INFO.image) {
$(CURRENT_SITE_INFO.image.selector).val(info.image);
}
if (CURRENT_SITE_NAME.match(/HDHome|PTHome|SoulVoice|1PTBA|HDAtmos|3Wmg/i)) {
setTimeout(() => {
const event = new Event("change");
document.querySelector(CURRENT_SITE_INFO.category.selector).dispatchEvent(event);
}, 1e3);
}
if (CURRENT_SITE_INFO.anonymous) {
const {selector, value = ""} = CURRENT_SITE_INFO.anonymous;
if (value) {
$(selector).val(value);
} else {
$(selector).attr("checked", true);
}
}
if (CURRENT_SITE_INFO.tags) {
Object.keys(info.tags).forEach((key) => {
if (info.tags[key] && CURRENT_SITE_INFO.tags[key]) {
$(CURRENT_SITE_INFO.tags[key]).attr("checked", true);
}
});
}
fillTeamName(info);
if (CURRENT_SITE_NAME.match(/PTHome|HDSky|LemonHD|1PTBA|52pt/i)) {
if (info.tags.diy) {
let categoryValue = "";
if (CURRENT_SITE_NAME === "PTHome") {
categoryValue = info.videoType === "bluray" ? "14" : "13";
} else if (CURRENT_SITE_NAME === "HDSky") {
categoryValue = info.videoType === "bluray" ? "12" : "14";
} else if (CURRENT_SITE_NAME === "LemonHD") {
$('select[name="tag_diy"]').val("yes");
return;
} else if (CURRENT_SITE_NAME === "1PTBA") {
categoryValue = info.videoType === "bluray" ? "1" : "4";
} else if (CURRENT_SITE_NAME === "52pt") {
categoryValue = info.videoType === "bluray" ? "2" : "12";
}
$(CURRENT_SITE_INFO.videoType.selector).val(categoryValue);
}
}
if (CURRENT_SITE_NAME.match(/HDU/)) {
let videoTypeValue = "";
const {resolution, videoType, category} = info;
const isTV = category.match(/tv/);
if (videoType === "remux") {
if (resolution === "2160p") {
videoTypeValue = isTV ? "16" : "15";
} else {
videoTypeValue = isTV ? "12" : "3";
}
}
if (isTV) {
if (videoType === "encode") {
videoTypeValue = "14";
} else if (videoType === "web") {
videoTypeValue = "13";
}
}
if (videoTypeValue) {
$(CURRENT_SITE_INFO.videoType.selector).val(videoTypeValue);
}
if (videoType.match(/bluray/)) {
$(CURRENT_SITE_INFO.category.selector).val("424");
}
}
if (CURRENT_SITE_NAME === "TJUPT") {
$("#browsecat").change();
tjupt_default(info);
}
if (CURRENT_SITE_NAME === "NYPT") {
$("#browsecat").change();
const domTimeout = setTimeout(() => {
const catMap = {
movie: "#movie_enname",
tv: "#series_enname",
tvPack: "#series_enname",
documentary: "#doc_enname",
variety: "#show_enname",
cartoon: "#anime_enname"
};
const selector = catMap[info.category];
if (selector) {
$(selector).val(info.title);
}
clearTimeout(domTimeout);
}, 2e3);
}
if (CURRENT_SITE_INFO.siteType === "UNIT3D" && info.category.match(/tv/)) {
const season = (_f = (_e = info.title.match(/S0?(\d{1,2})/i)) == null ? void 0 : _e[1]) != null ? _f : 1;
const episode = (_h = (_g = info.title.match(/EP?0?(\d{1,3})/i)) == null ? void 0 : _g[1]) != null ? _h : 0;
$("#season_number").val(season);
$("#episode_number").val(episode);
}
if (CURRENT_SITE_NAME === "HDRoute") {
hdr_default(info);
}
if (CURRENT_SITE_NAME === "HDT") {
if (info.category !== "tvPack") {
$('select[name="season"').val("true");
}
if (imdbId) {
$(CURRENT_SITE_INFO.imdb.selector).val(`https://www.imdb.com/title/${imdbId}/`);
}
}
if (CURRENT_SITE_NAME === "PTer") {
const language = (_j = (_i = info.description.match(/(语\s+言)\s+(.+)/)) == null ? void 0 : _i[2]) != null ? _j : "";
if (!language.match(/英语/) && info.area === "EU") {
$(CURRENT_SITE_INFO.area.selector).val("8");
}
}
if (CURRENT_SITE_NAME === "HDHome") {
if (info.title.match(/iPad/i)) {
const categoryMap = {
movie: "412",
tv: "426",
tvPack: "433",
documentary: "418"
};
const ipadCat = categoryMap[info.category];
if (ipadCat) {
$("#browsecat").val(ipadCat);
}
}
}
if (CURRENT_SITE_NAME === "Bib" && ((_k = info.doubanBookInfo) == null ? void 0 : _k.success)) {
bib_default(info);
}
if (CURRENT_SITE_NAME === "iTS") {
its_default(info);
}
if (CURRENT_SITE_NAME === "UHDBits") {
$(CURRENT_SITE_INFO.imdb.selector).val(imdbId);
const teamName = getTeamName(info);
$("#team").val(teamName === "other" ? "Unknown" : teamName);
if (info.title.match(/web-?rip/i)) {
$(CURRENT_SITE_INFO.videoType.selector).val("WEBRip");
}
$("#imdb_button").click();
}
if (CURRENT_SITE_NAME === "52PT") {
const {tags, videoType, resolution} = info;
let videoTypeValue = videoType;
if (videoType.match(/bluray/)) {
if (tags.chinese_audio || tags.cantonese_audio || tags.chinese_subtitle) {
videoTypeValue = videoType === "bluray" ? "14" : "15";
}
} else if (videoType === "remux" && resolution === "2160p") {
videoTypeValue = "5";
}
$(CURRENT_SITE_INFO.videoType.selector).val(videoTypeValue);
}
if (CURRENT_SITE_NAME === "BTSCHOOL") {
$(imdbSelector).val(imdbId);
if (info.doubanUrl) {
const doubanId = (_m = (_l = info.doubanUrl.match(/\/(\d+)/)) == null ? void 0 : _l[1]) != null ? _m : "";
$(CURRENT_SITE_INFO.douban.selector).val(doubanId);
}
}
if (CURRENT_SITE_NAME === "PTN") {
ptn_default(info);
}
if (CURRENT_SITE_NAME === "HDTime") {
if (info.videoType.match(/bluray/i)) {
$(CURRENT_SITE_INFO.category.selector).val("424");
}
}
};
var matchSelectForm = (siteInfo, movieInfo, key, selectArray) => {
const valueArray = siteInfo[key] ? siteInfo[key].map[movieInfo[key]] : void 0;
if (Array.isArray(valueArray) && selectArray) {
if (siteInfo[key].selector) {
$(siteInfo[key].selector).val(valueArray.shift());
}
if (selectArray.length > 1) {
selectArray = selectArray.filter((item) => valueArray.includes(item));
}
} else if (siteInfo[key] && siteInfo[key].selector) {
$(siteInfo[key].selector).val(valueArray);
}
return selectArray;
};
var fillTeamName = (info) => {
const teamConfig = CURRENT_SITE_INFO.team;
const teamName = getTeamName(info);
if (teamName && teamConfig) {
const formateTeamName = teamConfig.map[teamName.toLowerCase()];
const matchValue = formateTeamName || teamConfig.map.other;
if (HDB_TEAM.includes(teamName) && CURRENT_SITE_NAME === "BTSCHOOL") {
$(teamConfig.selector).val(teamConfig.map.hdbint);
return;
}
if (CURRENT_SITE_NAME === "HDAI" && !formateTeamName) {
$('input[name="team"]').val(teamName);
return;
}
if (matchValue) {
$(teamConfig.selector).val(matchValue.toLowerCase());
}
}
};
var disableTorrentChange = () => {
var _a, _b;
const nameSelector = (_b = (_a = CURRENT_SITE_INFO.name) == null ? void 0 : _a.selector) != null ? _b : "";
if (nameSelector.match(/^#\w+/)) {
const nameDom = $(nameSelector).clone().attr("name", "").hide();
$(nameSelector).attr("id", "").after(nameDom);
}
};
var filterNexusDescription = (info) => {
const {description} = info;
let filterDescription = "";
const quoteList = description.match(/\[quote(=\w+)?\](.|\n)+?\[\/quote\]/g);
if (quoteList && quoteList.length > 0) {
quoteList.forEach((quote) => {
const isMediaInfoOrBDInfo = quote.match(/Disc\s?Size|\.mpls|Unique\s?ID|唯一ID|Resolution/i);
if (!quote.match(/[\u4e00-\u9fa5]+/i) || isMediaInfoOrBDInfo) {
filterDescription += quote + "\n";
}
});
}
const allImages = getFilterImages(description);
return filterDescription + "\n" + allImages.join("");
};
var getThanksQuote = (info) => {
const isChineseSite = isChineseTacker(CURRENT_SITE_INFO.siteType) || CURRENT_SITE_NAME.match(/HDPOST|GPW/);
let thanksQuote = `\u8F6C\u81EA[b]${info.sourceSite}[/b]\uFF0C\u611F\u8C22\u539F\u53D1\u5E03\u8005\uFF01`;
if (!isChineseSite) {
thanksQuote = `Torrent from [b]${info.sourceSite}[/b].
All thanks to the original uploader\uFF01`;
}
return `[quote]${thanksQuote}[/quote]
`;
};
var isChineseTacker = (siteType) => {
return siteType.match(/NexusPHP|TTG/);
};
var filterEmptyTags = (description) => {
const reg = new RegExp("\\[(\\w+)(?:=(?:\\w|\\s)+)?\\]\\s*\\[\\/(\\w+)\\]", "g");
if (description.match(reg)) {
description = description.replace(reg, function(match, p1, p2) {
if (p1 === p2) {
return "";
}
});
return filterEmptyTags(description);
} else {
return description;
}
};
// src/source/ptp.js
var ptp_default2 = async () => {
var _a, _b, _c;
const torrentId = getUrlParam("torrentid");
if (!torrentId) {
return false;
}
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
const torrentDom = $(`#torrent_${torrentId}`);
const ptpMovieTitle = (_a = $(".page__title").text().match(/]?([^[]+)/)[1]) == null ? void 0 : _a.trim();
const [movieName, movieAkaName = ""] = ptpMovieTitle.split(" AKA ");
const mediaInfoArray = [];
torrentDom.find(".mediainfo.mediainfo--in-release-description").next("blockquote").each(function() {
const textContent = $(this).text();
if (textContent.match(/(Codec\s*ID)|mpls|(Stream\s*size)|Video/i)) {
mediaInfoArray.push(textContent);
}
});
TORRENT_INFO.movieName = movieName;
TORRENT_INFO.movieAkaName = movieAkaName;
TORRENT_INFO.imdbUrl = (_c = (_b = $("#imdb-title-link")) == null ? void 0 : _b.attr("href")) != null ? _c : "";
TORRENT_INFO.year = $(".page__title").text().match(/\[(\d+)\]/)[1];
const torrentHeaderDom = $(`#group_torrent_header_${torrentId}`);
TORRENT_INFO.category = getPTPType();
const screenshots = getPTPImage(torrentDom);
getDescription2(torrentId).then((res) => {
const releaseName = torrentHeaderDom.data("releasename");
const releaseGroup = getReleaseGroup(releaseName);
const descriptionData = formatDescriptionData(res, screenshots, mediaInfoArray);
TORRENT_INFO.description = descriptionData;
const infoArray = torrentHeaderDom.find("#PermaLinkedTorrentToggler").text().trim().split(" / ");
const [codes, container, source, resolution, ...otherInfo] = infoArray;
const isRemux = otherInfo.includes("Remux");
const {knownTags, otherTags} = getTags(otherInfo, [releaseGroup]);
TORRENT_INFO.videoType = source === "WEB" ? "web" : getVideoType(container, isRemux, codes, source);
const isBluray = TORRENT_INFO.videoType.match(/bluray/i);
TORRENT_INFO.tags = __assign({}, knownTags);
TORRENT_INFO.otherTags = otherTags;
TORRENT_INFO.resolution = resolution;
const mediaInfoOrBDInfo = mediaInfoArray.filter((media) => {
return TORRENT_INFO.videoType.match(/bluray/) ? media.match(/mpls/i) : !media.match(/mpls/i);
});
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
TORRENT_INFO.mediaInfo = mediaInfoOrBDInfo.join("\n\n").trim();
TORRENT_INFO.mediaInfos = mediaInfoOrBDInfo.map((v) => v.trim());
const {videoCodec, audioCodec, mediaTags} = getInfoFunc(mediaInfoOrBDInfo.join("\n\n"));
TORRENT_INFO.videoCodec = videoCodec;
TORRENT_INFO.audioCodec = audioCodec;
TORRENT_INFO.tags = __assign(__assign({}, TORRENT_INFO.tags), mediaTags);
const torrentName = formatTorrentTitle(releaseName);
TORRENT_INFO.title = torrentName;
TORRENT_INFO.source = getPTPSource(source, codes, resolution);
TORRENT_INFO.size = torrentHeaderDom.find(".nobr span").attr("title").replace(/[^\d]/g, "");
TORRENT_INFO.screenshots = screenshots;
console.log(TORRENT_INFO);
});
let country = [];
const matchArray = $("#movieinfo div").text().match(/Country:\s+([^\n]+)/);
if (matchArray && matchArray.length > 0) {
country = matchArray == null ? void 0 : matchArray[1].replace(/(,)\s+/g, "$1").split(",");
}
TORRENT_INFO.area = getAreaCode(country == null ? void 0 : country[0]);
return TORRENT_INFO;
};
var getPTPType = () => {
const typeMap = {
"Feature Film": "movie",
"Short Film": "movie",
"Stand-up Comedy": "other",
Miniseries: "tvPack",
"Live Performance": "concert",
"Movie Collection": "movie"
};
const ptpType = $("#torrent-table .basic-movie-list__torrent-edition__main").eq(0).text();
return typeMap[ptpType];
};
var getPTPImage = () => {
const imgList = [];
const torrentInfoPanel = $(".movie-page__torrent__panel");
const imageDom = torrentInfoPanel.find(".bbcode__image");
for (let i = 0; i < imageDom.length; i++) {
const parent = imageDom[i].parentElement;
if (parent.tagName === "A" && parent.getAttribute("href").match(/\.png$/)) {
imgList.push(parent.getAttribute("href"));
} else {
imgList.push(imageDom[i].getAttribute("src"));
}
}
return imgList;
};
var getPTPSource = (source, codes, resolution) => {
if (codes.match(/BD100|BD66/i)) {
return "uhdbluray";
}
if (source.match(/Blu-ray/i) && resolution.match(/2160P|4K/i)) {
return "uhdbluray";
}
return source.replace(/-/g, "").toLowerCase();
};
var getVideoType = (container, isRemux, codes, source) => {
let type = "";
if (isRemux) {
type = "remux";
} else if (codes.match(/BD50|BD25/ig)) {
type = "bluray";
} else if (codes.match(/BD66|BD100/ig)) {
type = "uhdbluray";
} else if (source.match(/DVD/ig) && container.match(/MKV|AVI/ig)) {
type = "dvdrip";
} else if (codes.match(/DVD5|DVD9/ig) && container.match(/VOB|ISO/ig)) {
type = "dvd";
} else if (container.match(/MKV|MP4/i)) {
type = "encode";
}
return type;
};
var getDescription2 = async (id) => {
const url = `https://passthepopcorn.me/torrents.php?action=get_description&id=${id}`;
const data = await fetch(url, {
responseType: "text"
});
if (data) {
const element = document.createElement("span");
element.innerHTML = data;
return element.innerText || element.textContent;
}
return "";
};
var formatDescriptionData = (data, screenshots, mediaInfoArray) => {
let descriptionData = data.replace(/\r\n/g, "\n");
descriptionData = descriptionData.split("\n").map((line) => {
return line.trim();
}).join("\n");
TORRENT_INFO.originalDescription = descriptionData;
screenshots.forEach((screenshot) => {
const regStr = new RegExp(`\\[img\\]${screenshot}\\[\\/img\\]`, "i");
if (!descriptionData.match(regStr)) {
descriptionData = descriptionData.replace(new RegExp(screenshot, "g"), `[img]${screenshot}[/img]`);
}
});
descriptionData = descriptionData.replace(/\[(\/)?mediainfo\]/g, "[$1quote]");
descriptionData = descriptionData.replace(/\[(\/)?hide(?:=(.+?))?\]/g, function(match, p1, p2) {
const slash = p1 || "";
return p2 ? `${p2}: [${slash}quote]` : `[${slash}quote]`;
});
descriptionData = descriptionData.replace(/\[(\/)?pre\]/g, "[$1quote]");
descriptionData = descriptionData.replace(/\[align(=(.+?))\]((.|\n)+?)\[\/align\]/g, "[$2]$3[/$2]");
const comparisonArray = descriptionData.match(/(\n.+\n)?\[comparison=(?:.+?)\]((.|\n|\s)+?)\[\/comparison\]/ig) || [];
const comparisons = [];
comparisonArray.forEach((item) => {
descriptionData = descriptionData.replace(item, item.replace(/\s/g, ""));
const reason = item.match(/(\n.*\n)?\[comparison=/i)[1] || "";
const title = item.match(/\[comparison=(.*?)\]/i)[1];
const comparisonImgArray = item.replace(/\[\/?comparison(=(.+?))?\]/ig, "").split(/[ \r\n]/);
const imgs = [];
[...new Set(comparisonImgArray)].forEach((item2) => {
const formatImg = item2.replace(/\s*/g, "");
if (item2.match(/^https?.+/)) {
imgs.push(formatImg);
descriptionData = descriptionData.replace(new RegExp(`(? {
const regStr = new RegExp(`\\[quote\\]\\s*?${replaceRegSymbols(mediaInfo).slice(0, 1e4)}`, "i");
if (!descriptionData.match(regStr)) {
descriptionData = descriptionData.replace(mediaInfo, `[quote]${mediaInfo}[/quote]`);
}
});
if (TORRENT_INFO.category === "concert") {
descriptionData = $("#synopsis").text() + "\n" + descriptionData;
}
return descriptionData;
};
function getTags(rawTags, exclude = []) {
const knownTags = {};
const otherTags = {};
for (const rawTag of rawTags) {
const tag = CURRENT_SITE_INFO.sourceInfo.editionTags[rawTag];
if (tag) {
knownTags[tag] = true;
} else if (tag === null || exclude.includes(rawTag) || rawTag.match(/Freeleech|Halfleech/i)) {
} else {
otherTags[rawTag] = true;
}
}
return {
knownTags,
otherTags
};
}
function getReleaseGroup(releasename) {
var _a;
return (_a = releasename.match(/-(\w+?)$/)) == null ? void 0 : _a[1];
}
// src/source/bhd.js
var bhd_default = async () => {
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
const basicInfo = getBasicInfo();
const editionTags = getEditionTags(basicInfo);
const {Category, Name, Source, Type, Size} = basicInfo;
TORRENT_INFO.size = getSize(Size);
TORRENT_INFO.title = formatTorrentTitle(Name);
const tags = getTagsFromSubtitle(TORRENT_INFO.title);
const TMDBYear = $(".movie-heading a:last").text();
const movieName = $(".movie-heading a:first").text();
if (!TMDBYear) {
const matchYear = TORRENT_INFO.title.match(/\s([12][90]\d{2})/);
TORRENT_INFO.year = matchYear ? matchYear[0] : "";
} else {
TORRENT_INFO.year = TMDBYear;
}
const descriptionDom = $(".panel-heading:contains(Description)").next(".panel-body").find(".forced-nfo");
const descriptionBBCode = getFilterBBCode(descriptionDom[0]);
const {category: movieCat, countries, imdbUrl} = getMovieDetails();
TORRENT_INFO.movieName = movieName;
let category = Category.toLowerCase().replace(/s/, "");
category = movieCat === "Animation" ? "cartoon" : category;
TORRENT_INFO.category = getPreciseCategory(TORRENT_INFO, category);
TORRENT_INFO.source = getSource2(Source, Type);
TORRENT_INFO.area = getAreaCode(countries);
TORRENT_INFO.videoType = getVideoType2(Type);
const isBluray = TORRENT_INFO.videoType.match(/bluray/i);
const mediaInfo = $("#stats-full code").text();
TORRENT_INFO.mediaInfo = mediaInfo;
TORRENT_INFO.mediaInfos = [mediaInfo];
TORRENT_INFO.originalDescription = descriptionBBCode;
TORRENT_INFO.description = `${descriptionBBCode}
[quote]${mediaInfo}[/quote]`;
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {videoCodec, audioCodec, resolution, mediaTags} = getInfoFunc(mediaInfo);
TORRENT_INFO.videoCodec = videoCodec;
TORRENT_INFO.audioCodec = audioCodec;
TORRENT_INFO.resolution = resolution;
TORRENT_INFO.tags = __assign(__assign(__assign({}, tags), mediaTags), editionTags.knownTags);
TORRENT_INFO.otherTags = editionTags.otherTags;
TORRENT_INFO.imdbUrl = imdbUrl;
TORRENT_INFO.screenshots = getImages();
return TORRENT_INFO;
};
var getBasicInfo = () => {
const basicInfo = {};
$(".dotborder").each((index, element) => {
const key = $(element).find("td:first").text();
const value = $(element).find("td:last").text();
basicInfo[key] = value.replace(/\n/g, "").trim();
});
console.log(basicInfo);
return basicInfo;
};
var getMovieDetails = () => {
const infoList = $(".movie-details a");
const movieDetail = {};
infoList.each((index, element) => {
const urlParams = $(element).attr("href").replace(/.+\?/g, "").split("=");
if (urlParams.length > 1) {
let key = decodeURI(urlParams[0]);
const value = urlParams[1];
if (key === "g[]") {
key = "category";
}
movieDetail[key] = value;
} else if (urlParams == null ? void 0 : urlParams[0].match(/tt\d+/)) {
movieDetail.imdbUrl = urlParams[0];
}
});
return movieDetail;
};
var getImages = () => {
var _a;
const screenshots = (_a = TORRENT_INFO.description.match(/\[url=.+?\]\[img\].+?\[\/img\]\[\/url]/g)) != null ? _a : [];
return screenshots;
};
var getSource2 = (source, resolution) => {
if (resolution.match(/BD100|BD66/i)) {
return "uhdbluray";
}
if (source.match(/Blu-ray/i) && resolution.match(/UHD/i)) {
return "uhdbluray";
}
if (source.match(/WEB|WEB-DL/i)) {
return "web";
}
return source.replace(/-/g, "").toLowerCase();
};
var getVideoType2 = (type) => {
type = type.replace(/\s/g, "");
if (type.match(/Remux/i)) {
return "remux";
} else if (type.match(/BD50|BD25/i)) {
return "bluray";
} else if (type.match(/UHD50|UHD66|UHD100/i)) {
return "uhdbluray";
} else if (type.match(/DVD5|DVD9/i)) {
return "dvd";
} else if (type.match(/\d{3,4}p/i)) {
return "encode";
}
return type;
};
var getEditionTags = ({Video, Audio, Hybrid, Edition, Region, Extras}) => {
const knownTags = {};
const otherTags = {};
const text = [Video, Audio, Edition, Extras].filter((v) => Boolean(v)).join(" / ");
for (const [source, target] of Object.entries(CURRENT_SITE_INFO.sourceInfo.editionTags)) {
if (text.includes(source)) {
knownTags[target] = true;
}
;
}
if (Hybrid) {
otherTags.Hybrid = true;
}
if (knownTags.hdr10_plus && knownTags.hdr10) {
delete knownTags.hdr10;
}
return {
knownTags,
otherTags
};
};
// src/source/hdb.js
var hdb_default = async () => {
var _a, _b;
const torrentId = getUrlParam("id");
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
const editDom = $("#details tr").has("a:contains(Edit torrent)");
const descriptionDom = editDom.length > 0 ? editDom.prev() : $("#details tr").has(".js-tagcontent").prev();
let descriptionBBCode = getFilterBBCode(descriptionDom.find(">td")[0]);
descriptionBBCode = (_b = (_a = descriptionBBCode.match(/\[quote\]((.|\n)+)\[\/quote\]/)) == null ? void 0 : _a[1]) != null ? _b : "";
TORRENT_INFO.description = descriptionBBCode;
const {size, category, videoType} = getBasicInfo2();
const title = $("h1").eq(0).text();
TORRENT_INFO.title = formatTorrentTitle(title);
const tags = getTagsFromSubtitle(title);
const isMovieType = $(".contentlayout h1").length > 0;
const IMDBLinkDom = isMovieType ? $(".contentlayout h1") : $("#details .showlinks li").eq(1);
if (isMovieType) {
const IMDBYear = IMDBLinkDom.prop("lastChild").nodeValue.replace(/\s|\(|\)/g, "");
const movieName = IMDBLinkDom.find("a").text();
TORRENT_INFO.movieName = movieName;
if (!IMDBYear) {
const matchYear = TORRENT_INFO.title.match(/\s([12][90]\d{2})/);
TORRENT_INFO.year = matchYear ? matchYear[0] : "";
} else {
TORRENT_INFO.year = IMDBYear;
}
}
TORRENT_INFO.imdbUrl = IMDBLinkDom.find("a").attr("href");
TORRENT_INFO.category = getPreciseCategory(TORRENT_INFO, category);
TORRENT_INFO.source = getSourceFromTitle(TORRENT_INFO.title);
TORRENT_INFO.videoType = videoType;
const isBluray = TORRENT_INFO.videoType.match(/bluray/i);
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {bdinfo} = getBDInfoOrMediaInfo(descriptionBBCode);
if (!isBluray) {
TORRENT_INFO.bdinfo = bdinfo;
getMediaInfo(torrentId).then((data) => {
if (data) {
TORRENT_INFO.mediaInfo = data;
descriptionBBCode += `
[quote]${data}[/quote]`;
TORRENT_INFO.description = descriptionBBCode;
const {videoCodec, audioCodec, resolution, mediaTags} = getInfoFunc(TORRENT_INFO.mediaInfo);
TORRENT_INFO.videoCodec = videoCodec;
TORRENT_INFO.audioCodec = audioCodec;
TORRENT_INFO.resolution = resolution;
TORRENT_INFO.tags = __assign(__assign({}, tags), mediaTags);
}
});
} else {
TORRENT_INFO.mediaInfo = bdinfo;
const {videoCodec, audioCodec, resolution, mediaTags} = getInfoFunc(bdinfo || descriptionBBCode);
TORRENT_INFO.videoCodec = videoCodec;
TORRENT_INFO.audioCodec = audioCodec;
TORRENT_INFO.resolution = resolution;
TORRENT_INFO.tags = __assign(__assign({}, tags), mediaTags);
}
TORRENT_INFO.size = size;
TORRENT_INFO.screenshots = getImages2();
};
var getBasicInfo2 = () => {
const videoTypeMap = {
"Blu-ray/HD DVD": "bluray",
Capture: "hdtv",
Encode: "encode",
Remux: "remux",
"WEB-DL": "web"
};
const info = $("th:contains(Category)").next().text();
const size = $("th:contains(Size)").eq(0).next().text();
const splitArray = info.split("(");
const category = splitArray[0].trim().toLowerCase();
const videoCodec = splitArray[1].split(",")[0].toLowerCase().replace(/\./g, "");
const videoType = splitArray[1].split(",")[1].replace(/\)/g, "").trim();
return {
size: getSize(size),
category,
videoCodec,
videoType: videoTypeMap[videoType]
};
};
var getMediaInfo = async (torrentId) => {
const res = await fetch(`https://hdbits.org/details/mediainfo?id=${torrentId}`, {
responseType: "text"
});
const data = res.replace(/\r\n/g, "\n");
return data || "";
};
var getImages2 = () => {
var _a;
const screenshots = (_a = TORRENT_INFO.description.match(/\[url=.+?\]\[img\].+?\[\/img\]\[\/url]/g)) != null ? _a : [];
return screenshots;
};
// src/source/ttg.js
var ttg_default = async () => {
var _a, _b;
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
const headTitle = $("#main_table h1").eq(0).text();
const title = (_a = headTitle.match(/[^[]+/)) == null ? void 0 : _a[0];
TORRENT_INFO.title = formatTorrentTitle(title);
TORRENT_INFO.subtitle = headTitle.replace(title, "").replace(/\[|\]/g, "");
const tags = getTagsFromSubtitle(TORRENT_INFO.subtitle + TORRENT_INFO.title);
const mediaTecInfo = getTorrentValueDom("\u7C7B\u578B").text();
const {category, area, videoType} = getCategoryAndArea(mediaTecInfo);
TORRENT_INFO.area = area;
TORRENT_INFO.videoType = getVideoType3(title, videoType);
const year = TORRENT_INFO.title.match(/(18|19|20)\d{2}/g);
TORRENT_INFO.year = year ? year.pop() : "";
TORRENT_INFO.imdbUrl = getTorrentValueDom("IMDB").find("a").attr("href");
TORRENT_INFO.source = getSourceFromTitle(TORRENT_INFO.title);
const sizeStr = (_b = getTorrentValueDom("\u5C3A\u5BF8").text().match(/\(((\d|,)+)\s*字节\)/i)) == null ? void 0 : _b[1];
TORRENT_INFO.size = sizeStr.replace(/,/g, "");
const isBluray = TORRENT_INFO.videoType.match(/bluray/i);
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
TORRENT_INFO.isForbidden = !!$("#kt_d").text().match(/禁转/);
window.onload = () => {
var _a2, _b2, _c, _d, _e, _f, _g;
const descriptionDom = $("#kt_d");
let bbCodes = getFilterBBCode(descriptionDom[0]);
const discountMatch = (_b2 = (_a2 = bbCodes.match(/\[color=\w+\]本种子.+?\[\/color\]/)) == null ? void 0 : _a2[0]) != null ? _b2 : "";
if (bbCodes.match) {
bbCodes = bbCodes.replace(discountMatch, "");
}
TORRENT_INFO.description = bbCodes;
const doubanUrl = (_c = bbCodes.match(/https:\/\/(movie\.)?douban.com\/subject\/\d+/)) == null ? void 0 : _c[0];
if (doubanUrl) {
TORRENT_INFO.doubanUrl = doubanUrl;
}
const areaMatch = (_d = bbCodes.match(/(产\s+地|国\s+家)\s+(.+)/)) == null ? void 0 : _d[2];
if (areaMatch) {
TORRENT_INFO.area = getAreaCode(areaMatch);
}
if (!category) {
TORRENT_INFO.category = getCategoryFromDesc(bbCodes);
} else {
TORRENT_INFO.category = getPreciseCategory(TORRENT_INFO, category);
}
const {bdinfo, mediaInfo} = getBDInfoOrMediaInfo(bbCodes);
const mediaInfoOrBDInfo = isBluray ? bdinfo : mediaInfo;
if (mediaInfoOrBDInfo) {
TORRENT_INFO.mediaInfo = mediaInfoOrBDInfo;
const {videoCodec, audioCodec, resolution, mediaTags} = getInfoFunc(mediaInfoOrBDInfo);
TORRENT_INFO.videoCodec = videoCodec;
TORRENT_INFO.audioCodec = audioCodec;
TORRENT_INFO.resolution = resolution;
TORRENT_INFO.tags = __assign(__assign({}, tags), mediaTags);
} else {
let resolution = (_e = TORRENT_INFO.title.match(/\d{3,4}(p|i)/i)) == null ? void 0 : _e[0];
if (!resolution && resolution.match(/4k|uhd/i)) {
resolution = "2160p";
}
TORRENT_INFO.resolution = resolution;
TORRENT_INFO.audioCodec = getAudioCodecFromTitle(TORRENT_INFO.title);
if (bbCodes.match(/VIDEO(\.| )*CODEC/i)) {
const matchCodec = (_f = bbCodes.match(/VIDEO(\.| )*CODEC\.*:?\s*([^\s_:]+)?/i)) == null ? void 0 : _f[2];
if (matchCodec) {
TORRENT_INFO.videoCodec = matchCodec.replace(/\.|-/g, "").toLowerCase();
} else {
const {title: title2} = TORRENT_INFO;
TORRENT_INFO.videoCodec = getVideoCodecFromTitle(title2);
}
}
if (bbCodes.match(/AUDIO\s*CODEC/i)) {
const matchCodec = (_g = bbCodes.match(/AUDIO\s*CODEC\.*:?\s*(.+)/i)) == null ? void 0 : _g[1];
if (matchCodec) {
TORRENT_INFO.audioCodec = getAudioCodecFromTitle(matchCodec);
}
}
}
TORRENT_INFO.screenshots = getImages3(bbCodes);
console.log(TORRENT_INFO);
};
};
var getCategoryAndArea = (mediaInfo) => {
let category = "";
let area = "";
let videoType = "";
if (mediaInfo.match(/电影/)) {
category = "movie";
} else if (mediaInfo.match(/剧包/)) {
category = "tvPack";
} else if (mediaInfo.match(/剧/)) {
category = "tv";
} else if (mediaInfo.match(/纪录/)) {
category = "documentary";
} else if (mediaInfo.match(/综艺/)) {
category = "variety";
} else if (mediaInfo.match(/体育/)) {
category = "sport";
} else if (mediaInfo.match(/演唱会/)) {
category = "concert";
} else if (mediaInfo.match(/动漫/)) {
category = "cartoon";
}
if (mediaInfo.match(/韩/)) {
area = "KR";
} else if (mediaInfo.match(/日/)) {
area = "JP";
} else if (mediaInfo.match(/华/)) {
area = "CN";
} else if (mediaInfo.match(/欧/)) {
area = "US";
}
if (mediaInfo.match(/UHD原盘/i)) {
videoType = "uhdbluray";
} else if (mediaInfo.match(/bluray原盘/i)) {
videoType = "bluray";
} else if (mediaInfo.match(/DVD/i)) {
videoType = "dvd";
}
return {
category,
area,
videoType
};
};
var getImages3 = (bbcode) => {
var _a;
if (bbcode.match(/More\.Screens/i)) {
const moreScreen = (_a = bbcode.match(/\.More\.Screens\[\/u\]\[\/color\]\n((.|\n)+\[\/(url|img)\])/)) == null ? void 0 : _a[1];
return getScreenshotsFromBBCode(moreScreen);
} else {
return getScreenshotsFromBBCode(bbcode);
}
};
var getVideoType3 = (title, videoType) => {
if (title.match(/HDTV/i)) {
return "hdtv";
} else if (title.match(/web(-)*(dl|rip)/i)) {
return "web";
} else if (title.match(/remux/i)) {
return "remux";
} else if (title.match(/dvdrip/i)) {
return "dvdrip";
} else if (title.match(/x264|x265/i)) {
return "encode";
}
return videoType;
};
var getTorrentValueDom = (key) => {
return $(`#main_table td.heading:contains(${key})`).next();
};
var getCategoryFromDesc = (desc) => {
let category = "movie";
const {title, subtitle} = TORRENT_INFO;
if (title.match(/s0?\d{1,2}/i) || desc.match(/集\s*数/)) {
if (title.match(/s0?\d{1,2}e0\d{1,2}/i) || subtitle.match(/第[^\s]集/)) {
category = "tv";
} else {
category = "tvPack";
}
} else if (desc.match(/动画/)) {
category = "cartoon";
} else if (desc.match(/纪录/)) {
category = "documentary";
}
return category;
};
// src/source/unit3d.js
var unit3d_default = async () => {
var _a, _b, _c, _d, _e, _f;
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
const {Category, Name, Type, Size, Resolution} = getBasicInfo3();
TORRENT_INFO.size = getSize(Size);
let title = formatTorrentTitle(Name);
const tags = getTagsFromSubtitle(TORRENT_INFO.title);
const category = getCategory(Category);
const videoType = getVideoType4(Type, Resolution);
let IMDBYear = $(".movie-heading span:last").text();
const movieName = $(".movie-heading span:first").text();
if (CURRENT_SITE_NAME === "HDPOST") {
const englishTitle = (_b = (_a = title.match(/[\s\W\d]+(.+)/)) == null ? void 0 : _a[1]) != null ? _b : "";
TORRENT_INFO.subtitle = (_c = title.replace(englishTitle, "")) == null ? void 0 : _c.trim();
title = englishTitle;
}
if (CURRENT_SITE_NAME === "ACM") {
title = title.replace(/\/\s+\W+/, "");
}
if (!IMDBYear) {
const matchYear = TORRENT_INFO.title.match(/(19|20)\d{2}/g);
IMDBYear = (_d = matchYear == null ? void 0 : matchYear.pop()) != null ? _d : "";
} else {
IMDBYear = IMDBYear.replace(/\(|\)|\s/g, "");
}
const imdbUrl = $(".movie-details a:contains(IMDB)").attr("href");
const resolution = (_e = Resolution.match(/\d+(i|p)/i)) == null ? void 0 : _e[0];
const descriptionDom = $(".fa-sticky-note").parents(".panel-heading").siblings(".table-responsive").find(".panel-body").clone();
descriptionDom.find("#collection_waypoint").remove();
let descriptionBBCode = getFilterBBCode(descriptionDom[0]);
const mediaInfo = $(".decoda-code code").text();
const {bdinfo} = getBDInfoOrMediaInfo(descriptionBBCode);
if (mediaInfo) {
descriptionBBCode += `
[quote]${mediaInfo}[/quote]`;
}
const isBluray = videoType.match(/bluray/i);
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const mediaInfoOrBDInfo = isBluray ? bdinfo : mediaInfo;
const {videoCodec, audioCodec, mediaTags} = getInfoFunc(mediaInfoOrBDInfo);
TORRENT_INFO.mediaInfo = mediaInfoOrBDInfo;
TORRENT_INFO.videoCodec = videoCodec;
TORRENT_INFO.audioCodec = audioCodec;
TORRENT_INFO.tags = __assign(__assign({}, tags), mediaTags);
TORRENT_INFO.screenshots = (_f = descriptionBBCode.match(/\[url=.+?\]\[img\].+?\[\/img\]\[\/url]/g)) != null ? _f : [];
TORRENT_INFO.title = title;
TORRENT_INFO.year = IMDBYear;
TORRENT_INFO.movieName = CURRENT_SITE_NAME === "HDPOST" ? "" : movieName;
TORRENT_INFO.resolution = resolution;
TORRENT_INFO.imdbUrl = imdbUrl;
TORRENT_INFO.poster = $(".movie-poster").attr("src");
TORRENT_INFO.category = getPreciseCategory(TORRENT_INFO, category);
TORRENT_INFO.source = getSourceFromTitle(title);
TORRENT_INFO.videoType = videoType.toLowerCase();
TORRENT_INFO.description = descriptionBBCode;
return TORRENT_INFO;
};
var getBasicInfo3 = () => {
const basicInfo = {};
const keyMap = {
Name: "Name",
\u540D\u79F0: "Name",
\u540D\u7A31: "Name",
Size: "Size",
\u4F53\u79EF: "Size",
\u9AD4\u7A4D: "Size",
Category: "Category",
\u7C7B\u522B: "Category",
\u985E\u5225: "Category",
Type: "Type",
\u89C4\u683C: "Type",
\u898F\u683C: "Type",
Resolution: "Resolution"
};
let lineSelector = $("#vue+.panel table tr");
if (CURRENT_SITE_NAME.match(/Blutopia|HDPOST/)) {
lineSelector = $("#meta-info+.meta-general>.panel:first table tr");
}
lineSelector.each((index, element) => {
const key = $(element).find("td:first").text().replace(/\s|\n/g, "");
if (keyMap[key]) {
const value = $(element).find("td:last").text();
basicInfo[keyMap[key]] = value.replace(/\n/g, "").trim();
}
});
return basicInfo;
};
var getCategory = (key) => {
if (!key) {
return "";
}
if (key.match(/movie|电影/i)) {
return "movie";
} else if (key.match(/tv|电视|剧集/i)) {
return "tv";
}
};
var getVideoType4 = (type, resolution) => {
type = type.replace(/\s/g, "");
if (type.match(/FullDisc/)) {
if (resolution.match(/2160p/i)) {
return "uhdbluray";
} else if (resolution.match(/1080/)) {
return "bluray";
} else {
return "dvd";
}
} else if (type.match(/Encode/i)) {
return "encode";
} else if (type.match(/web/i)) {
return "web";
} else if (type.match(/HDTV/i)) {
return "hdtv";
}
return type;
};
// src/source/nexusphp.js
var nexusphp_default = async () => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
let title = formatTorrentTitle((_b = (_a = $("#top").text().split(/\s{3,}/)) == null ? void 0 : _a[0]) == null ? void 0 : _b.trim());
let metaInfo = $("td.rowhead:contains('\u57FA\u672C\u4FE1\u606F'), td.rowhead:contains('\u57FA\u672C\u8CC7\u8A0A')").next().text().replace(/:/g, ":");
let subtitle = $("td.rowhead:contains('\u526F\u6807\u9898'), td.rowhead:contains('\u526F\u6A19\u984C')").next().text();
let siteImdbUrl = $("#kimdb>a").attr("href");
let descriptionBBCode = getFilterBBCode($("#kdescr")[0]);
if (CURRENT_SITE_NAME === "MTeam") {
descriptionBBCode = descriptionBBCode.replace(/https:\/\/\w+?\.m-team\.cc\/imagecache.php\?url=/g, "").replace(/(http(s)?)%3A/g, "$1:").replace(/%2F/g, "/");
}
if (CURRENT_SITE_NAME === "HDArea") {
title = (_d = (_c = $("h1#top").text().split(/\s{3,}/)) == null ? void 0 : _c[0]) == null ? void 0 : _d.trim();
}
if (CURRENT_SITE_NAME === "TJUPT") {
const matchArray = title.match(/\[[^\]]+(\.|\s)+[^\]]+\]/g) || [];
const realTitle = (_f = (_e = matchArray.filter((item) => item.match(/\.| /))) == null ? void 0 : _e[0]) != null ? _f : "";
title = realTitle.replace(/\[|\]/g, "");
}
if (CURRENT_SITE_NAME === "PTer") {
if ($("#descrcopyandpaster")[0]) {
descriptionBBCode = (_g = $("#descrcopyandpaster").val()) == null ? void 0 : _g.replace(/hide(=(MediaInfo|BDInfo))?\]/ig, "quote]");
} else {
descriptionBBCode = getFilterBBCode($("#kdescr")[0]);
}
}
if (CURRENT_SITE_NAME === "LemonHD") {
descriptionBBCode = descriptionBBCode.replace(/\[b\]\[color=\w+\][^[]+?网上搜集[^[]+?\[\/color\]\[\/b\]/, "");
}
if (CURRENT_SITE_NAME === "HDChina") {
const meta = [];
$("li:contains('\u57FA\u672C\u4FE1\u606F'):last").next("li").children("i").each(function() {
meta.push($(this).text().replace("\uFF1A", ":"));
});
metaInfo = meta.join("\xA0\xA0\xA0");
subtitle = $("#top").next("h3").text();
}
if (CURRENT_SITE_NAME === "OurBits") {
siteImdbUrl = $(".imdbnew2 a:first").attr("href");
TORRENT_INFO.doubanUrl = $("#doubaninfo .doubannew a").attr("href");
if (TORRENT_INFO.doubanUrl) {
const doubanInfo = getFilterBBCode((_h = $(".doubannew2 .doubaninfo")) == null ? void 0 : _h[0]);
const doubanPoster = `[img]${$("#doubaninfo .doubannew a img").attr("src")}[/img]
`;
TORRENT_INFO.doubanInfo = doubanPoster + doubanInfo;
}
}
if (CURRENT_SITE_NAME === "KEEPFRDS") {
[title, subtitle] = [subtitle, title];
siteImdbUrl = $("#kimdb .imdbwp__link").attr("href");
TORRENT_INFO.doubanUrl = $("#kdouban .imdbwp__link").attr("href");
const element = document.createElement("div");
$(element).html($("#outer td").has("#kdescr").html());
descriptionBBCode = getFilterBBCode(element);
}
if (CURRENT_SITE_NAME === "SSD") {
TORRENT_INFO.doubanUrl = $(".douban_info a:contains('://movie.douban.com/subject/')").attr("href");
const doubanInfo = getFilterBBCode((_i = $(".douban-info artical")) == null ? void 0 : _i[0]);
const postUrl = (_k = (_j = $("#kposter").find("img")) == null ? void 0 : _j.attr("src")) != null ? _k : "";
const doubanPoster = postUrl ? `[img]${postUrl} [/img]
` : "";
TORRENT_INFO.doubanInfo = doubanPoster + (doubanInfo == null ? void 0 : doubanInfo.replace(/\n{2,}/g, "\n"));
if (descriptionBBCode === "" || descriptionBBCode === void 0) {
let extraTextInfo = getFilterBBCode((_l = $(".torrent-extra-text-container .extra-text")) == null ? void 0 : _l[0]);
extraTextInfo = extraTextInfo ? `
[quote]${extraTextInfo}[/quote]
` : "";
const extraScreenshotDom = $(".screenshot").find("img");
const imgs = [];
if (extraScreenshotDom) {
extraScreenshotDom.each((index, item) => {
imgs.push(`[img]${$(item).attr("src").trim()}[/img]`);
});
}
const extraScreenshot = imgs.join("");
const mediaInfo2 = $("section[data-group='mediainfo'] .codemain").text();
const extraMediaInfo = `
[quote]${mediaInfo2}[/quote]
`;
TORRENT_INFO.mediaInfo = mediaInfo2;
descriptionBBCode = extraTextInfo + extraMediaInfo + extraScreenshot;
}
siteImdbUrl = $(".douban_info a:contains('://www.imdb.com/title/')").attr("href");
}
if (CURRENT_SITE_NAME === "LemonHD") {
metaInfo += $("td.rowhead:contains('\u8BE6\u7EC6\u4FE1\u606F')").next().text().replace(/:/g, ":");
if (metaInfo.match(/分辨率:/) === null) {
metaInfo = metaInfo.replace("\u5206\u8FA8\u7387", "\u5206\u8FA8\u7387:");
}
}
const year = title.match(/(19|20)\d{2}/g);
const {category, videoType, videoCodec, audioCodec, resolution, processing, size} = getMetaInfo(metaInfo);
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
const doubanUrl = (_m = descriptionBBCode.match(/https:\/\/((movie|book)\.)?douban.com\/subject\/\d+/)) == null ? void 0 : _m[0];
if (doubanUrl) {
TORRENT_INFO.doubanUrl = doubanUrl;
}
const imdbUrl = (_n = descriptionBBCode.match(/http(s)?:\/\/www.imdb.com\/title\/tt\d+/)) == null ? void 0 : _n[0];
if (imdbUrl) {
TORRENT_INFO.imdbUrl = imdbUrl;
} else if (siteImdbUrl) {
TORRENT_INFO.imdbUrl = siteImdbUrl.match(/www.imdb.com\/title/) ? siteImdbUrl : "";
}
TORRENT_INFO.year = year ? year.pop() : "";
TORRENT_INFO.title = title;
TORRENT_INFO.subtitle = subtitle;
TORRENT_INFO.description = descriptionBBCode;
const originalName = (_p = (_o = descriptionBBCode.match(/(片\s+名)\s+(.+)?/)) == null ? void 0 : _o[2]) != null ? _p : "";
const translateName = (_r = (_q = descriptionBBCode.match(/(译\s+名)\s+(.+)/)) == null ? void 0 : _q[2]) != null ? _r : "";
if (!originalName.match(/[\u4e00-\u9fa5]+/)) {
TORRENT_INFO.movieName = originalName;
} else {
TORRENT_INFO.movieName = (_u = (_t = (_s = translateName.match(/(\w|\s){2,}/)) == null ? void 0 : _s[0]) == null ? void 0 : _t.trim()) != null ? _u : "";
}
const fullInformation = $("#top").text() + subtitle + descriptionBBCode;
const isForbidden = fullInformation.match(/独占|禁转|严禁转载|谢绝转载|exclusive/);
TORRENT_INFO.isForbidden = !!isForbidden;
if (!processing || processing.match(/raw|encode/)) {
const areaMatch = (_v = descriptionBBCode.match(/(产\s+地|国\s+家)】?\s*(.+)/)) == null ? void 0 : _v[2];
if (areaMatch) {
TORRENT_INFO.area = getAreaCode(areaMatch);
}
} else {
TORRENT_INFO.area = getAreaCode(processing);
}
const specificCategory = getPreciseCategory(TORRENT_INFO, getCategory2(category || descriptionBBCode));
TORRENT_INFO.category = specificCategory;
TORRENT_INFO.videoType = getVideoType5(videoType || TORRENT_INFO.title);
TORRENT_INFO.source = getSourceFromTitle(TORRENT_INFO.title);
TORRENT_INFO.size = size ? getSize(size) : "";
TORRENT_INFO.screenshots = getScreenshotsFromBBCode(descriptionBBCode);
const tags = getTagsFromSubtitle(TORRENT_INFO.subtitle);
const pageTags = getTagsFromPage();
TORRENT_INFO.tags = __assign(__assign({}, tags), pageTags);
if (CURRENT_SITE_NAME.match(/beitai/i)) {
if (descriptionBBCode.match(/VIDEO\s*(\.)?CODEC/i)) {
const matchCodec = (_w = descriptionBBCode.match(/VIDEO\s*(\.)?CODEC\.*:?\s*([^\s_,]+)?/i)) == null ? void 0 : _w[2];
if (matchCodec) {
let videoCodec2 = matchCodec.replace(/\.|-/g, "").toLowerCase();
videoCodec2 = videoCodec2.match(/hevc/i) ? "x265" : videoCodec2;
videoCodec2 = videoCodec2.match(/mpeg4/i) ? "x264" : videoCodec2;
TORRENT_INFO.videoCodec = videoCodec2;
}
}
} else {
TORRENT_INFO.videoCodec = getVideoCodecFromTitle(TORRENT_INFO.title || videoCodec, TORRENT_INFO.videoType);
}
TORRENT_INFO.resolution = getResolution3(resolution || TORRENT_INFO.title);
TORRENT_INFO.audioCodec = getAudioCodecFromTitle(audioCodec || TORRENT_INFO.title);
const isBluray = TORRENT_INFO.videoType.match(/bluray/i);
const {bdinfo, mediaInfo} = getBDInfoOrMediaInfo(descriptionBBCode);
const mediaInfoOrBDInfo = isBluray ? bdinfo : TORRENT_INFO.mediaInfo || mediaInfo;
if (mediaInfoOrBDInfo) {
TORRENT_INFO.mediaInfo = mediaInfoOrBDInfo;
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {videoCodec: videoCodec2, audioCodec: audioCodec2, resolution: resolution2, mediaTags} = getInfoFunc(mediaInfoOrBDInfo);
if (videoCodec2 !== "" && audioCodec2 !== "" && resolution2 !== "") {
TORRENT_INFO.videoCodec = videoCodec2;
TORRENT_INFO.audioCodec = audioCodec2;
TORRENT_INFO.resolution = resolution2;
TORRENT_INFO.tags = __assign(__assign({}, TORRENT_INFO.tags), mediaTags);
}
}
if (CURRENT_SITE_INFO === "TCCF") {
TORRENT_INFO.format = getFormat3(videoType);
} else {
TORRENT_INFO.format = getFormat3($("#top").text() + subtitle);
}
};
var getMetaInfo = (metaInfo) => {
let resolutionKey = "\u5206\u8FA8\u7387|\u89E3\u6790\u5EA6|\u683C\u5F0F";
let videoTypeKey = "\u5A92\u4ECB|\u6765\u6E90|\u8D28\u91CF";
if (CURRENT_SITE_NAME === "SSD") {
resolutionKey = "\u5206\u8FA8\u7387|\u89E3\u6790\u5EA6";
videoTypeKey = "\u683C\u5F0F";
}
if (CURRENT_SITE_NAME.match(/TLF|HDAI|HDHome/i)) {
videoTypeKey = "\u5A92\u4ECB";
}
const category = getMetaValue("\u7C7B\u578B|\u5206\u7C7B|\u985E\u5225", metaInfo);
const videoType = getMetaValue(videoTypeKey, metaInfo);
const videoCodec = getMetaValue("\u7F16\u7801|\u7DE8\u78BC", metaInfo);
const audioCodec = getMetaValue("\u97F3\u9891|\u97F3\u9891\u7F16\u7801", metaInfo);
const resolution = getMetaValue(resolutionKey, metaInfo);
const processing = getMetaValue("\u5904\u7406|\u8655\u7406|\u5730\u533A", metaInfo);
const size = getMetaValue("\u5927\u5C0F", metaInfo);
console.log({
category,
videoType,
videoCodec,
audioCodec,
resolution,
processing,
size
});
return {
category,
videoType,
videoCodec,
audioCodec,
resolution,
processing,
size
};
};
var getMetaValue = (key, metaInfo) => {
var _a;
let regStr = `(${key}):\\s?([^\u4E00-\u9FA5]+)?`;
if (key.match(/大小/)) {
regStr = `(${key}):\\s?((\\d|\\.)+\\s+(G|M|T|K)(i)?B)`;
}
if (CURRENT_SITE_NAME.match(/KEEPFRDS|TJUPT|PTSBAO|PTHome|HDTime|BTSCHOOL|TLF|HDAI|SoulVoice/) && key.match(/类型/)) {
regStr = `(${key}):\\s?([^\\s]+)?`;
}
if (CURRENT_SITE_NAME === "PTer" && key.match(/类型|地区/)) {
regStr = `(${key}):\\s?([^\\s]+)?`;
}
if (CURRENT_SITE_NAME === "HDSky" && key.match(/类型/)) {
regStr = `(${key}):\\s?.+?/([^\\s]+)?`;
}
if (CURRENT_SITE_NAME === "TCCF" && key.match(/类型/)) {
regStr = `(${key}):(.+?)\\s{2,}`;
}
const reg = new RegExp(regStr);
const matchValue = (_a = metaInfo.match(reg, "i")) == null ? void 0 : _a[2];
if (matchValue) {
return matchValue.replace(/\s/g, "").trim().toLowerCase();
}
};
var getVideoType5 = (videoType) => {
if (!videoType) {
return "";
}
videoType = videoType.replace(/[.-]/g, "").toLowerCase();
if (videoType.match(/encode|x264|x265|bdrip|hdrip/ig)) {
return "encode";
} else if (videoType.match(/remux/ig)) {
return "remux";
} else if (videoType.match(/uhd|ultra/ig)) {
return "uhdbluray";
} else if (videoType.match(/blu/ig)) {
return "bluray";
} else if (videoType.match(/webdl/ig)) {
return "web";
} else if (videoType.match(/hdtv/ig)) {
return "hdtv";
} else if (videoType.match(/dvdr/ig)) {
return "dvdrip";
} else if (videoType.match(/dvd/ig)) {
return "dvd";
}
return "";
};
var getCategory2 = (category) => {
if (!category) {
return "";
}
category = category.replace(/[.-]/g, "").toLowerCase();
if (category.match(/movie|bd|ultra|电影/ig)) {
return "movie";
} else if (category.match(/综艺/ig)) {
return "variety";
} else if (category.match(/tv|drama|剧集|电视/ig)) {
return "tv";
} else if (category.match(/TVSeries/ig)) {
return "tvPack";
} else if (category.match(/document|纪录|紀錄|Doc/ig)) {
return "documentary";
} else if (category.match(/sport|体育/ig)) {
return "sport";
} else if (category.match(/mv|演唱|concert/ig)) {
return "concert";
} else if (category.match(/anim|动(画|漫)/ig)) {
return "cartoon";
} else if (category.match(/App|软件|Software|軟體/ig)) {
return "app";
} else if (category.match(/电子书|小说|Ebook/ig)) {
return "ebook";
} else if (category.match(/有声书|AudioBook/ig)) {
return "audiobook";
} else if (category.match(/杂志|magazine/ig)) {
return "magazine";
} else if (category.match(/漫画|comics/ig)) {
return "comics";
} else if (category.match(/公开课/ig)) {
return "onlineCourse";
} else if (category.match(/资料/ig)) {
return "ebook";
}
return "";
};
var getResolution3 = (resolution) => {
resolution = resolution === void 0 ? "" : resolution.toLowerCase();
if (resolution.match(/4k|2160|UHD/ig)) {
return "2160p";
} else if (resolution.match(/1080(p)?/ig)) {
return "1080p";
} else if (resolution.match(/1080i/ig)) {
return "1080i";
} else if (resolution.match(/720(p)?/ig)) {
return "720p";
} else if (resolution.match(/sd/ig)) {
return "480p";
}
return resolution;
};
var getFormat3 = (data) => {
if (data.match(/pdf/i)) {
return "pdf";
} else if (data.match(/EPUB/i)) {
return "epub";
} else if (data.match(/MOBI/i)) {
return "mobi";
} else if (data.match(/mp3/i)) {
return "mp3";
} else if (data.match(/mp4/i)) {
return "mp4";
} else if (data.match(/txt/i)) {
return "txt";
} else if (data.match(/azw3/i)) {
return "azw3";
} else if (data.match(/镜像/i)) {
return "iso";
}
return "other";
};
var getTagsFromPage = () => {
let tags = {};
if (CURRENT_SITE_NAME === "PTer") {
const tagImgs = $("td.rowhead:contains('\u7C7B\u522B\u4E0E\u6807\u7B7E')").next().find("img");
const links = Array.from(tagImgs.map(function() {
return $(this).attr("src").replace(/(lang\/chs\/)|(\.gif)/g, "");
}));
if (links.includes("pter-zz")) {
tags.chinese_subtitle = true;
}
if (links.includes("pter-gy")) {
tags.chinese_audio = true;
}
if (links.includes("pter-yy")) {
tags.cantonese_audio = true;
}
if (links.includes("pter-diy")) {
tags.diy = true;
}
} else {
const tagText = $("td.rowhead:contains('\u6807\u7B7E')").next().text();
tags = getTagsFromSubtitle(tagText);
}
return tags;
};
// src/source/hdt.js
var hdt_default = async () => {
var _a, _b, _c, _d, _e;
const title = document.title.replace(/HD-Torrents.org\s*-/ig, "").trim();
const imdbInfoDom = $("#IMDBDetailsInfoHideShowTR .imdbnew2");
const imdbUlrDom = imdbInfoDom.find(">a");
const imdbUrl = imdbUlrDom.attr("href");
const movieName = imdbUlrDom.text();
const year = (_b = (_a = imdbInfoDom.text().match(/Year:\s*(\d{4})/)) == null ? void 0 : _a[1]) != null ? _b : "";
const country = (_d = (_c = imdbInfoDom.text().match(/Country:\s*([^\n]+)/)) == null ? void 0 : _c[1]) != null ? _d : "";
const {Category, Size, Genre} = getBasicInfo4();
let tags = getTagsFromSubtitle(title);
let category = Category.toLowerCase().split(/\s|\//)[0];
category = Genre.match(/Animation/i) ? "cartoon" : category;
const videoType = getVideoType6(Category, title);
const source = getSourceFromTitle(title);
let resolution = (_e = title.match(/\d{3,4}(p|i)/i)) == null ? void 0 : _e[0];
if (!resolution && resolution.match(/4k|uhd/i)) {
resolution = "2160p";
}
TORRENT_INFO.videoCodec = getVideoCodecFromTitle(title);
TORRENT_INFO.audioCodec = getAudioCodecFromTitle(title);
const descriptionDom = $("#technicalInfoHideShowTR");
let descriptionBBCode = getFilterBBCode(descriptionDom[0]);
descriptionBBCode = descriptionBBCode.replace(/\[center\]((?:.|\n)+?)\[\/center\]/g, (match, p1) => {
if (p1.match(/(keep seeding)|(spank your ass)/)) {
return "";
} else {
return match;
}
});
const isBluray = videoType.match(/bluray/i);
const {bdinfo, mediaInfo} = getBDInfoOrMediaInfo(descriptionBBCode);
const mediaInfoOrBDInfo = isBluray ? bdinfo : TORRENT_INFO.mediaInfo || mediaInfo;
if (mediaInfoOrBDInfo) {
TORRENT_INFO.mediaInfo = mediaInfoOrBDInfo;
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {videoCodec, audioCodec, resolution: mediaResolution, mediaTags} = getInfoFunc(mediaInfoOrBDInfo);
if (videoCodec !== "" && audioCodec !== "" && resolution !== "") {
TORRENT_INFO.videoCodec = videoCodec;
TORRENT_INFO.audioCodec = audioCodec;
resolution = mediaResolution;
tags = __assign(__assign({}, tags), mediaTags);
}
}
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
TORRENT_INFO.title = formatTorrentTitle(title);
TORRENT_INFO.year = year;
TORRENT_INFO.movieName = movieName;
TORRENT_INFO.source = source;
TORRENT_INFO.area = getAreaCode(country);
TORRENT_INFO.size = getSize(Size);
TORRENT_INFO.videoType = videoType;
TORRENT_INFO.resolution = resolution;
TORRENT_INFO.tags = tags;
TORRENT_INFO.imdbUrl = imdbUrl;
TORRENT_INFO.description = descriptionBBCode;
TORRENT_INFO.category = getPreciseCategory(TORRENT_INFO, category);
TORRENT_INFO.screenshots = getScreenshotsFromBBCode(descriptionBBCode);
};
var getBasicInfo4 = () => {
const basicInfo = {};
$(".detailsleft").each((index, element) => {
const key = $(element).text().replace(/:/g, "").trim();
const value = $(element).next("td").text();
if (value) {
basicInfo[key] = value.replace(/\n/g, "").trim();
}
});
return basicInfo;
};
var getVideoType6 = (type, title) => {
if (type.match(/Remux/i)) {
return "remux";
} else if (type.match(/UHD\/Blu-Ray/i)) {
return "uhdbluray";
} else if (type.match(/Blu-Ray/i)) {
return "bluray";
}
if (title.match(/HDTV/i)) {
return "hdtv";
} else if (title.match(/web(-)*(dl|rip)/i)) {
return "web";
} else if (title.match(/dvdrip/i)) {
return "dvdrip";
} else if (title.match(/x264|x265/i)) {
return "encode";
}
return "";
};
// src/source/kg.js
var kg_default = async () => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
const {InternetLink, Year, Type, Genres, Source, Size, Filename = "", RipSpecs = "", Subtitles, "Language(s)": language} = getBasicInfo5();
const torrentFileDom = getBasicInfoDom("Download").find("a.index");
const torrentFileName = torrentFileDom.text().replace(/\.torrent$/, "");
const fileName = Filename.replace(/\.\w+$/, "");
const title = formatTorrentTitle(fileName || torrentFileName);
const imdbUrl = (InternetLink == null ? void 0 : InternetLink.match(/imdb/)) ? InternetLink : "";
const [movieName, movieAkaName = ""] = (_a = $(".outer h1").text().split("- ")) == null ? void 0 : _a[1].replace(/\(\d+\)/, "").trim().split(/AKA/i);
const country = $(".outer h1 img").attr("alt");
const year = Year;
const size = (_b = Size.match(/\((.+?)\)/)) == null ? void 0 : _b[1].replace(/,|(bytes)/g, "");
let tags = getTagsFromSubtitle(title);
if (Subtitles.match(/Chinese/i)) {
tags.chinese_subtitle = true;
}
if (language.match(/Chinese|Mandarin/i)) {
tags.chinese_audio = true;
}
if (language.match(/Cantonese/)) {
tags.cantonese_audio = true;
}
let category = Type.toLowerCase();
category = Genres.match(/Animation/i) ? "cartoon" : category;
const mediaInfo = $("div.mediainfo").text();
let source = Source.replace(/-/g, "").toLowerCase();
if (source === "tv") {
source = "hdtv";
}
let genreVideoType = (_e = (_d = (_c = getBasicInfoDom("Genres").find("tr td>img").attr("src")) == null ? void 0 : _c.match(/genreimages\/(\w+)\.\w+/)) == null ? void 0 : _d[1]) != null ? _e : "";
genreVideoType = RipSpecs.match(/DVD\sFormat/) ? "dvdr" : genreVideoType;
const videoType = getVideoType7(title, source, genreVideoType, !!mediaInfo);
let resolution = (_g = (_f = title.match(/\d{3,4}(p|i)/i)) == null ? void 0 : _f[0]) != null ? _g : "";
if (!resolution && resolution.match(/4k|uhd/i)) {
resolution = "2160p";
}
TORRENT_INFO.videoCodec = getVideoCodecFromTitle(title);
TORRENT_INFO.audioCodec = getAudioCodecFromTitle(title);
if (genreVideoType === "dvdr" && RipSpecs) {
TORRENT_INFO.videoCodec = "mpeg2";
const audioCodec = (_i = (_h = RipSpecs.match(/DVD\sAudio:(.+)/)) == null ? void 0 : _h[1]) != null ? _i : "";
TORRENT_INFO.audioCodec = getAudioCodecFromTitle(audioCodec);
resolution = "480p";
}
const descriptionDom = getBasicInfoDom("Description");
let descriptionBBCode = getFilterBBCode(descriptionDom.find("article")[0]);
descriptionBBCode = descriptionBBCode.replace(/(.|\n)+?_{5,}/g, "");
const isBluray = videoType.match(/bluray/i);
const {bdinfo} = getBDInfoOrMediaInfo(descriptionBBCode);
const mediaInfoOrBDInfo = isBluray ? bdinfo : mediaInfo;
if (mediaInfoOrBDInfo) {
TORRENT_INFO.mediaInfo = mediaInfoOrBDInfo;
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {videoCodec, audioCodec, resolution: mediaResolution, mediaTags} = getInfoFunc(mediaInfoOrBDInfo);
if (videoCodec !== "" && audioCodec !== "" && mediaResolution !== "") {
TORRENT_INFO.videoCodec = videoCodec;
TORRENT_INFO.audioCodec = audioCodec;
resolution = mediaResolution;
tags = __assign(__assign({}, tags), mediaTags);
}
}
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
TORRENT_INFO.title = formatTorrentTitle(title);
TORRENT_INFO.year = year;
TORRENT_INFO.movieName = movieName.trim();
TORRENT_INFO.movieAkaName = movieAkaName.trim();
TORRENT_INFO.source = source;
TORRENT_INFO.size = size;
TORRENT_INFO.videoType = videoType;
TORRENT_INFO.resolution = resolution;
TORRENT_INFO.tags = tags;
TORRENT_INFO.imdbUrl = imdbUrl;
TORRENT_INFO.area = getAreaCode(country);
TORRENT_INFO.description = descriptionBBCode;
TORRENT_INFO.category = getPreciseCategory(TORRENT_INFO, category);
TORRENT_INFO.screenshots = getScreenshotsFromBBCode(descriptionBBCode);
};
var getBasicInfo5 = () => {
const basicInfo = {};
$(".outer h1~table:first>tbody>tr").each((index, element) => {
const key = $(element).find("td.heading").text().replace(/\s/g, "");
const value = $(element).find("td.heading").next("td").text();
if (value) {
basicInfo[key] = value.replace(/\n/g, "").trim();
}
});
return basicInfo;
};
var getVideoType7 = (title, source, genreVideoType, hasMediainfo) => {
if (source) {
if (source === "bluray") {
const blurayFlag = genreVideoType === "bluray" || !hasMediainfo;
return blurayFlag ? "bluray" : "encode";
} else if (source === "dvd") {
const dvdFlag = genreVideoType === "dvdr" || !hasMediainfo;
return dvdFlag ? "dvd" : "dvdrip";
} else {
return source;
}
}
if (title.match(/UHD/i) && title.match(/Blu-Ray/i)) {
return "uhdbluray";
} else if (title.match(/Blu-Ray/i)) {
return "bluray";
} else if (title.match(/HDTV/i)) {
return "hdtv";
} else if (title.match(/web(-)*(dl|rip)/i)) {
return "web";
} else if (title.match(/dvdrip/i)) {
return "dvdrip";
} else if (title.match(/x264|x265/i)) {
return "encode";
}
return "";
};
var getBasicInfoDom = (key) => {
return $(`.outer h1~table:first>tbody>tr td:contains(${key})`).next("td");
};
// src/source/uhd.js
var uhd_default = async () => {
var _a, _b, _c, _d, _e, _f;
const torrentId = getUrlParam("torrentid");
if (!torrentId) {
return false;
}
const torrentFilePathDom = $(`#files_${torrentId} .filelist_path`);
const torrentFileDom = $(`#files_${torrentId} .filelist_table>tbody>tr:nth-child(2) td`).eq(0);
const torrentFileName = ((_a = torrentFilePathDom.text()) == null ? void 0 : _a.replace(/\//g, "")) || ((_b = torrentFileDom.text()) == null ? void 0 : _b.replace(/\.(mkv|mp4|avi|mpg|ts|iso)$/i, ""));
const title = formatTorrentTitle(torrentFileName);
const imdbUrl = $(".imovie_title .tooltip.imdb_icon").attr("href");
const titleText = $("#scontent h2").text();
const [movieName = "", movieAkaName = ""] = (_d = (_c = titleText.match(/(.+?)\[/)) == null ? void 0 : _c[1].split("/")) != null ? _d : [];
const year = (_f = (_e = titleText.match(/\[(\d+)\]/)) == null ? void 0 : _e[1]) != null ? _f : "";
let tags = getTagsFromSubtitle(title);
const source = getSourceFromTitle(title);
const category = title.match(/Season\s+\d+/) ? "tv" : "movie";
const size = getSize($(`#torrent${torrentId} td`).eq(1).text());
const infoArray = $(`#torrent${torrentId} td:first-child>a`).text().replace(/\s/g, "").split("/");
let [resolution, videoCodec, videoType] = infoArray;
videoType = getVideoType8(videoType, resolution);
TORRENT_INFO.videoCodec = getVideoCodecFromTitle(title) || videoCodec.replace(/\./g, "").toLowerCase();
TORRENT_INFO.audioCodec = getAudioCodecFromTitle(title);
const descriptionDom = $(`#torrent_${torrentId} #description`);
let descriptionBBCode = getFilterBBCode(descriptionDom[0]);
getMediaInfo2(torrentId).then((data) => {
if (data) {
TORRENT_INFO.mediaInfo = data;
descriptionBBCode += `
[quote]${data}[/quote]`;
TORRENT_INFO.description = descriptionBBCode;
TORRENT_INFO.screenshots = getScreenshotsFromBBCode(descriptionBBCode);
TORRENT_INFO.category = getPreciseCategory(TORRENT_INFO, category);
const isBluray = videoType.match(/bluray/i);
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {videoCodec: videoCodec2, audioCodec, mediaTags, resolution: mediaResolution} = getInfoFunc(data);
if (resolution === "mHD" && mediaResolution) {
resolution = mediaResolution;
}
if (videoCodec2 !== "" && audioCodec !== "") {
TORRENT_INFO.videoCodec = videoCodec2;
TORRENT_INFO.audioCodec = audioCodec;
tags = __assign(__assign({}, tags), mediaTags);
}
}
TORRENT_INFO.tags = tags;
TORRENT_INFO.resolution = resolution;
console.log(TORRENT_INFO);
});
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
TORRENT_INFO.title = title;
TORRENT_INFO.year = year;
TORRENT_INFO.movieName = movieName.trim();
TORRENT_INFO.movieAkaName = movieAkaName.trim();
TORRENT_INFO.source = source;
TORRENT_INFO.size = size;
TORRENT_INFO.imdbUrl = imdbUrl;
TORRENT_INFO.videoType = videoType;
};
var getMediaInfo2 = async (torrentId) => {
const url = `https://uhdbits.org/torrents.php?action=mediainfo&id=${torrentId}`;
const data = await fetch(url, {
responseType: "text"
});
return data || "";
};
var getVideoType8 = (videoType, resolution) => {
videoType = videoType.replace("-", "").toLowerCase();
if (videoType.match(/bluray/)) {
if (resolution === "2160p") {
return "uhdbluray";
}
} else if (videoType.match(/web/)) {
return "web";
} else if (videoType.match(/x264|x265/)) {
return "encode";
} else if (videoType.match(/x264|x265/)) {
return "encode";
} else if (videoType.match(/WEB/i)) {
return "web";
}
return videoType;
};
// src/source/btn.js
var btn_default = async () => {
const torrentId = getUrlParam("torrentid");
if (!torrentId) {
return false;
}
const torrentInfo = getTorrentInfo({torrentId});
const showInfo = await getShowInfo();
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
Object.assign(TORRENT_INFO, torrentInfo);
Object.assign(TORRENT_INFO, showInfo);
return TORRENT_INFO;
};
function getTorrentInfo({torrentId}) {
const torrentName = $(`#torrent_${torrentId}`).prev().find("> td").text().replace(/»/, "").trim();
const {container, source, size} = getSpecs({torrentId});
const seasonTitle = $("#content > div > h2").contents().last().text().trim();
const [season, year] = seasonTitle.match(/(.*) \[(\d+)\]/).slice(1);
const movieName = $("#content > div > h2 > a > img").attr("alt").replace(/\(\d+\)/, "").trim();
const description = getFilterBBCode($(`#torrent_${torrentId} > td > blockquote`).last()[0]);
const videoType = getVideoType9({torrentName, source});
const isBluray = videoType.match(/bluray/i);
const mediaInfoOrBDInfo = getBDInfoOrMediaInfo(description);
const mediaInfo = isBluray ? mediaInfoOrBDInfo.bdinfo : mediaInfoOrBDInfo.mediaInfo;
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {resolution, videoCodec, audioCodec, mediaTags: tags} = getInfoFunc(mediaInfo);
const category = getCategory3({season});
const sourceFrom = getSourceFromTitle(torrentName);
return {
title: formatTorrentTitle(torrentName),
format: container.toLowerCase(),
source: sourceFrom,
size: getSize(size),
resolution,
year,
movieName,
description,
videoType,
mediaInfo,
videoCodec,
audioCodec,
tags,
category
};
}
async function getShowInfo() {
var _a;
const seriesUrl = $("#content > .thin > h2 > a").prop("href");
const html = await fetch(seriesUrl, {
responseType: "text"
});
const infoHtml = html.match(/Series Info[\s\S]*?()/)[1];
const infoDom = new DOMParser().parseFromString(infoHtml, "text/html");
const info = Object.fromEntries(Array.from(infoDom.querySelectorAll("tr")).map((tr) => {
const tds = Array.from(tr.children);
return [tds[0].innerText.trim(), tds[1]];
}));
const country = info["Country:"].innerText;
const imdbUrl = (_a = info["External Links:"].innerHTML.match(/https:\/\/www\.imdb\.com\/title\/tt\d+/)) == null ? void 0 : _a[0];
return {
area: getAreaCode(country),
imdbUrl
};
}
var getVideoType9 = ({torrentName, source}) => {
if (torrentName.match(/remux/i)) {
return "remux";
} else if (["BD50", "BD25"].includes(source)) {
return "bluray";
} else if (["BD66", "BD100"].includes(source)) {
return "uhdbluray";
} else if (["WEB-DL"].includes(source)) {
return "web";
} else if (["HDTV"].includes(source)) {
return "encode";
} else {
return "";
}
;
};
function getCategory3({season}) {
return season.match(/season/i) ? "tvPack" : "tv";
}
function getSpecs({torrentId}) {
const specsDom = $(`#torrent_${torrentId}`).prev().prev();
const rawSpecs = specsDom.find("> td > a").text().replace(/»/, "").split("/").map((v) => v.trim());
const specs = rawSpecs.filter((v) => !["NFO"].includes(v));
const size = specsDom.find("> td").next("td").text().replace(/\s/g, "");
const [container, videoCodec, source, resolution, group] = specs;
return {
container,
videoCodec,
source,
resolution,
group,
size
};
}
// src/source/avistaz.js
var avistaz_default = async () => {
const torrentInfo = getTorrentInfo2();
torrentInfo.category = getPreciseCategory(torrentInfo, torrentInfo.category);
Object.assign(TORRENT_INFO, torrentInfo);
};
var getTorrentInfo2 = () => {
var _a, _b, _c, _d;
const imdbUrl = (_c = (_b = (_a = $('.badge-extra a[href*="www.imdb.com/title"]').attr("href")) == null ? void 0 : _a.split("?")) == null ? void 0 : _b[1]) != null ? _c : "";
const movieTitle = $(".block-titled h3 a").text();
const movieName = movieTitle.split("(")[0].trim();
const year = (_d = movieTitle.match(/\((\d+)\)/)) == null ? void 0 : _d[1];
let {Type, "File Size": size, Filename, "Video Quality": resolution, "Rip Type": videoType} = getBasicInfo6();
size = getSize(size);
const category = Type.toLowerCase().replace("-", "");
const title = formatTorrentTitle(Filename);
videoType = getVideoType10(videoType, resolution);
const country = $(".fa-flag~.badge-extra:first a").text();
const area = getAreaCode(country);
const source = getSourceFromTitle(title);
const tags = getTagsFromSubtitle(title);
const mediaInfoOrBDInfo = $("#collapseMediaInfo pre").text();
const screenshotsBBCode = $("#collapseScreens a").map(function() {
return `[url=${$(this).attr("href")}][img]${$(this).find("img").attr("src")}[/img][/url]`;
}).get();
const screenshots = getScreenshotsFromBBCode(screenshotsBBCode.join("\n"));
const isBluray = videoType.match(/bluray/i);
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {videoCodec, audioCodec, mediaTags} = getInfoFunc(mediaInfoOrBDInfo);
const descriptionBBCode = getFilterBBCode($(".torrent-desc")[0]);
const description = `${descriptionBBCode}
[quote]${mediaInfoOrBDInfo}[/quote]
${screenshotsBBCode.join("")}`;
return {
sourceSite: CURRENT_SITE_NAME,
sourceSiteType: CURRENT_SITE_INFO.siteType,
title,
imdbUrl,
movieName,
year,
size,
category,
videoType,
resolution,
area,
source,
videoCodec,
audioCodec,
screenshots,
mediaInfo: mediaInfoOrBDInfo,
description,
tags: __assign(__assign({}, tags), mediaTags)
};
};
var getBasicInfo6 = () => {
const basicInfo = {};
$("#content-area .block:last table:first>tbody>tr").each((index, element) => {
const key = $(element).find("td:first").text();
const value = $(element).find("td:last").text();
basicInfo[key] = value.replace(/\n/g, "").trim();
});
return basicInfo;
};
var getVideoType10 = (type, resolution) => {
if (type.match(/Remux/i)) {
return "remux";
} else if (type.match(/BluRay\s*Raw/i)) {
if (resolution === "2160p") {
return "uhdbluray";
}
return "bluray";
} else if (type.match(/HDTV/i)) {
return "hdtv";
} else if (type.match(/web(-)*(dl|rip)/i)) {
return "web";
} else if (type.match(/dvdrip/i)) {
return "dvdrip";
} else if (type.match(/DVD/)) {
return "dvd";
} else if (type.match(/rip/i)) {
return "encode";
}
return "";
};
// src/source/teamhd.js
var teamhd_default = async () => {
const torrentInfo = getTorrentInfo3();
torrentInfo.category = getPreciseCategory(torrentInfo, torrentInfo.category);
try {
let {movieName, year} = torrentInfo;
movieName = movieName.toLowerCase().replace(/\s/g, "_");
const url = `https://v2.sg.media-imdb.com/suggestion/${movieName[0]}/${movieName}_${year}.json`;
const imdbSearch = await fetch(url);
if (imdbSearch && imdbSearch.d.length) {
torrentInfo.imdbUrl = `https://www.imdb.com/title/${imdbSearch.d[0].id}`;
}
} catch (error) {
console.log(error);
}
Object.assign(TORRENT_INFO, torrentInfo);
};
var getTorrentInfo3 = () => {
var _a;
const basicInfoText = $(".download").text().replace(/.+?\//g, "").trim();
const year = basicInfoText.match(/\((\d{4})\)/)[1];
const movieName = basicInfoText.match(/(.+)\(\d{4}\)/)[1].trim();
const resolution = basicInfoText.match(/(\s*(\d+(p|i)))$/i)[2];
const videoType = getVideoType11(basicInfoText, resolution);
let size = $("#details_hop").text().match(/-\s*(.+?GB)/)[1];
size = getSize(size);
const category = getCategory4($('#details_hop a[href*="browse/cat"]').attr("href"));
const fileName = (_a = $(".download").attr("href").match(/name=(.+)/)[1].replace(/\.torrent/g, "")) == null ? void 0 : _a.replace(/\.(mkv|mp4|avi|mpg|ts|iso)$/i, "");
const title = formatTorrentTitle(fileName);
const source = getSourceFromTitle(title);
const tags = getTagsFromSubtitle(title);
const isBluray = videoType.match(/bluray/i);
const mediaInfo = $('.card-header:contains("MediaInfo") + .card-collapse .card-body').text();
const bdInfo = $('.card-header:contains("BDInfo") + .card-collapse .card-body').text();
const eacLogs = $('.card-header:contains("eac3to Log") + .card-collapse .card-body').text();
const mediaInfoOrBDInfo = isBluray ? bdInfo : mediaInfo;
const screenshotsBBCode = $('#details a[href*="teamhd.org/redirector.php"]').map(function() {
const url = $(this).attr("href").replace(/.+?url=/g, "");
return `[url=${url}][img]${$(this).find("img").attr("src")}[/img][/url]`;
}).get();
const screenshots = getScreenshotsFromBBCode(screenshotsBBCode.join("\n"));
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {videoCodec, audioCodec, mediaTags} = getInfoFunc(mediaInfoOrBDInfo);
const description = `[quote]${eacLogs}[/quote]
[quote]${mediaInfoOrBDInfo}[/quote]
${screenshotsBBCode.join("")}`;
return {
sourceSite: CURRENT_SITE_NAME,
sourceSiteType: CURRENT_SITE_INFO.siteType,
title,
movieName,
year,
size,
category,
videoType,
resolution,
source,
videoCodec,
audioCodec,
screenshots,
mediaInfo: mediaInfoOrBDInfo,
mediaInfos: [mediaInfoOrBDInfo],
description,
tags: __assign(__assign({}, tags), mediaTags)
};
};
var getCategory4 = (link) => {
const catNum = link.match(/cat(\d+)/)[1];
const map = {
29: "movie",
25: "cartoon",
28: "document",
31: "sport",
32: "tv",
33: "tvPack"
};
return map[catNum] || "";
};
var getVideoType11 = (type, resolution) => {
if (type.match(/Remux/i)) {
return "remux";
} else if (type.match(/Blu-Ray.+?Disc/i)) {
if (resolution === "2160p") {
return "uhdbluray";
}
return "bluray";
} else if (type.match(/HDTV/i)) {
return "hdtv";
} else if (type.match(/web(-)*(dl|rip)/i)) {
return "web";
} else if (type.match(/rip/i)) {
return "encode";
}
return "";
};
// src/source/hdspace.js
var hdspace_default = async () => {
var _a, _b, _c;
const {Name, Category, Size, Description} = getBasicInfo7();
const title = formatTorrentTitle(Name);
let tags = getTagsFromSubtitle(title);
const category = getCategory5(Category, title);
let resolution = (_a = title.match(/\d{3,4}(p|i)/i)) == null ? void 0 : _a[0];
if (!resolution && title.match(/4k|uhd/i)) {
resolution = "2160p";
}
const videoType = getVideoType12(Category, title);
const source = getSourceFromTitle(title);
TORRENT_INFO.videoCodec = getVideoCodecFromTitle(title);
TORRENT_INFO.audioCodec = getAudioCodecFromTitle(title);
const div = document.createElement("div");
div.innerHTML = Description.html();
$(div).find('#slidenfo,a[href*="#nfo"]').remove();
const descriptionBBCode = getFilterBBCode(div);
const isBluray = videoType.match(/bluray/i);
const {bdinfo, mediaInfo} = getBDInfoOrMediaInfo(descriptionBBCode);
const mediaInfoOrBDInfo = isBluray ? bdinfo : TORRENT_INFO.mediaInfo || mediaInfo;
if (mediaInfoOrBDInfo) {
TORRENT_INFO.mediaInfo = mediaInfoOrBDInfo;
const getInfoFunc = isBluray ? getInfoFromBDInfo : getInfoFromMediaInfo;
const {videoCodec, audioCodec, resolution: mediaResolution, mediaTags} = getInfoFunc(mediaInfoOrBDInfo);
if (videoCodec !== "" && audioCodec !== "" && resolution !== "") {
TORRENT_INFO.videoCodec = videoCodec;
TORRENT_INFO.audioCodec = audioCodec;
resolution = mediaResolution;
tags = __assign(__assign({}, tags), mediaTags);
}
}
const imdbId = $("#imdb").next("script").text().match(/mid=(\d+)/)[1];
const imdbData = await fetch(`${CURRENT_SITE_INFO.url}/getimdb.php?mid=${imdbId}`, {
responseType: "text"
});
const imdbDom = new DOMParser().parseFromString(imdbData, "text/html");
const imdbUlrDom = $('a[href*="imdb.com/title"]', imdbDom);
const imdbUrl = imdbUlrDom.attr("href");
const movieName = imdbUlrDom.text().replace(/\(\d+\)/g, "");
const year = (_c = (_b = imdbUlrDom.text().match(/\((\d{4})\)/)) == null ? void 0 : _b[1]) != null ? _c : "";
const country = $('td:contains("Country")', imdbDom).next("td").text();
TORRENT_INFO.sourceSite = CURRENT_SITE_NAME;
TORRENT_INFO.sourceSiteType = CURRENT_SITE_INFO.siteType;
TORRENT_INFO.title = formatTorrentTitle(title);
TORRENT_INFO.year = year;
TORRENT_INFO.movieName = movieName;
TORRENT_INFO.source = source;
TORRENT_INFO.size = getSize(Size);
TORRENT_INFO.videoType = videoType;
TORRENT_INFO.resolution = resolution;
TORRENT_INFO.area = getAreaCode(country);
TORRENT_INFO.tags = tags;
TORRENT_INFO.imdbUrl = imdbUrl;
TORRENT_INFO.description = descriptionBBCode;
TORRENT_INFO.category = getPreciseCategory(TORRENT_INFO, category);
TORRENT_INFO.screenshots = getScreenshotsFromBBCode(descriptionBBCode);
};
var getBasicInfo7 = () => {
const basicInfo = {};
$("#mcol .header").each(function() {
const key = $(this).text().trim();
const value = key === "Description" ? $(this).next("td") : $(this).next("td").text();
if (value && !basicInfo[key]) {
basicInfo[key] = key === "Description" ? value : value.replace(/\n/g, "").trim();
}
});
return basicInfo;
};
var getCategory5 = (cat, title) => {
if (cat.match(/movie/i)) {
return "movie";
} else if (cat.match(/hdtv/i)) {
return "tv";
} else if (cat.match(/doc/i)) {
return "documentary";
} else if (cat.match(/Animation/i)) {
return "cartoon";
} else if (cat.match(/Music\sVideos/i)) {
return "concert";
} else if (title.match(/S\d+(E\d+)?/i)) {
return "tv";
}
return "movie";
};
var getVideoType12 = (type, title) => {
if (type.match(/Remux/i)) {
return "remux";
} else if (type.match(/Blu-Ray/i) && title.match(/2160p|4k|uhd/i)) {
return "uhdbluray";
} else if (type.match(/Blu-Ray/i)) {
return "bluray";
}
if (title.match(/HDTV/i)) {
return "hdtv";
} else if (title.match(/blu-ray/i) && title.match(/2160p|4k|uhd/i)) {
return "uhdbluray";
} else if (title.match(/web(-)*(dl|rip)/i)) {
return "web";
} else if (title.match(/x264|x265/i)) {
return "encode";
}
return "";
};
// src/source/index.js
var getTorrentInfo4;
if (!CURRENT_SITE_INFO) {
getTorrentInfo4 = null;
} else if (CURRENT_SITE_INFO.siteType === "NexusPHP") {
getTorrentInfo4 = nexusphp_default;
} else if (CURRENT_SITE_NAME === "BeyondHD") {
getTorrentInfo4 = bhd_default;
} else if (CURRENT_SITE_NAME === "HDBits") {
getTorrentInfo4 = hdb_default;
} else if (CURRENT_SITE_NAME === "TTG") {
getTorrentInfo4 = ttg_default;
} else if (CURRENT_SITE_INFO.siteType === "UNIT3D") {
getTorrentInfo4 = unit3d_default;
} else if (CURRENT_SITE_NAME === "HDT") {
getTorrentInfo4 = hdt_default;
} else if (CURRENT_SITE_NAME === "KG") {
getTorrentInfo4 = kg_default;
} else if (CURRENT_SITE_NAME === "UHDBits") {
getTorrentInfo4 = uhd_default;
} else if (CURRENT_SITE_NAME === "PTP") {
getTorrentInfo4 = ptp_default2;
} else if (CURRENT_SITE_NAME === "BTN") {
getTorrentInfo4 = btn_default;
} else if (CURRENT_SITE_INFO.siteType === "AvistaZ") {
getTorrentInfo4 = avistaz_default;
} else if (CURRENT_SITE_NAME === "TeamHD") {
getTorrentInfo4 = teamhd_default;
} else if (CURRENT_SITE_NAME === "HDSpace") {
getTorrentInfo4 = hdspace_default;
}
var source_default = getTorrentInfo4;
// src/site-dom/main.js
var getSearchList = () => {
const searchListSetting = GM_getValue("easy-seed.enabled-search-site-list");
const searchSitesEnabled = searchListSetting ? JSON.parse(searchListSetting) : [];
const siteFaviconClosed = GM_getValue("easy-seed.site-favicon-closed") || "";
const searchList = SORTED_SITE_KEYS.map((siteName) => {
const siteInfo = PT_SITE[siteName];
if (siteInfo.search) {
if (searchSitesEnabled.length === 0 || searchSitesEnabled.includes(siteName)) {
const favIcon = siteFaviconClosed === "" && PT_SITE[siteName].icon ? PT_SITE[siteName].icon : "";
return `- ${favIcon} ${siteName} |
`;
}
}
return "";
});
return searchList;
};
var getFunctionItems = () => {
const {needDoubanBookInfo, needDoubanInfo} = CURRENT_SITE_INFO;
const doubanSearchDom = needDoubanBookInfo || needDoubanInfo ? `` : "";
const transferImgClosed = GM_getValue("easy-seed.transfer-img-closed") || "";
const doubanDom = needDoubanInfo || !TORRENT_INFO.doubanUrl && !needDoubanBookInfo ? `${doubanSearchDom}
` : "";
const doubanBookDom = needDoubanBookInfo ? `${doubanSearchDom}
` : "";
const transferDom = transferImgClosed || CURRENT_SITE_NAME === "BTN" ? "" : `
`;
const uploadImgClosed = GM_getValue("easy-seed.upload-img-closed") || "";
const uploadImgDom = uploadImgClosed || CURRENT_SITE_NAME === "BTN" ? "" : `
`;
return doubanDom || transferDom || doubanSearchDom ? `
${doubanDom}
${doubanBookDom}
${transferDom}
${uploadImgDom}
` : "";
};
var createSeedDom = (torrentDom, titleDom = "", searchListDom = "") => {
var _a, _b;
const targetSetting = GM_getValue("easy-seed.enabled-target-sites");
const targetSitesEnabled = targetSetting ? JSON.parse(targetSetting) : [];
const siteFaviconClosed = GM_getValue("easy-seed.site-favicon-closed") || "";
const siteList = SORTED_SITE_KEYS.map((siteName, index) => {
const {url, uploadPath} = PT_SITE[siteName];
const favIcon = siteFaviconClosed === "" && PT_SITE[siteName].icon ? PT_SITE[siteName].icon : "";
if (PT_SITE[siteName].asTarget) {
if (targetSitesEnabled.length === 0 || targetSitesEnabled.includes(siteName)) {
return `-
${favIcon} ${siteName}
|
`;
}
}
return "";
});
const gazelleSearchListDom = (_b = (_a = searchListDom.match(/