Skip to content

Commit

Permalink
fix(unit3d): adapt to the new version of unit3d(aither blutopia)
Browse files Browse the repository at this point in the history
  • Loading branch information
techmovie committed Jun 19, 2023
1 parent 946ec9c commit 6fde822
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/config/Aither.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ siteType: UNIT3D
icon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABO1BMVEUnPUA0UVVAZWpQfoRTgolJc3lIcXdSgYc5Wl4zUFQfMDIuSExCaG1SgYhckZhimKBbkJdajpVPfIJEa3Bdk5pXiZBLdnxFbXI4WFwvSU1PfYN1paxvoahsn6aGsLZhmKBbj5ZRgIZVho06W182VVlYi5Jgl59elJyLs7miw8eoxsqryMywy8+px8ucvsNrn6ZflZ0yTlJJcng/Y2iavcJtoKeBrbNelJtDaW4rREcxTVE9X2R5qK5KdHoqQkUoP0IsRUiNtbo3VlomOz5NeX8lOj0jNjkeLzEgMjQiNDchMzYkODslOTxYipEoPkEiNTgbKiwZJykcLC4dLS8uR0tBZmsaKCoZJig+YWYSHB0XIyUWIiQWISMfMTMRGhsVICIUHyATHR4cKy0QGRoTHh8YJScQGBkPFxj////TR8cdAAAAAWJLR0Roy2z0IgAAAAd0SU1FB+UEFw4WFlDBxPsAAAEBSURBVBjTFcppX4IwHADgPwmWmuWRVmCZdF9W2mmFlnlWNtBGY7YxWfL9v0H69vk9AMpCRFVVLaotaksxiENiObmymkpnsupaLr++sQmKbhS2UoVtwyjulEx9F/b2Dw6Pjk9Oz87LF1rpMgtXlap5faNG8+nb8l0ldw8PtcenZwvq9Yaiv5jVV2jWI2+tdqfb679bmWQsAR/Nz8FXHNkOGvZH2qgBqPfdH2LXdTFy2j/NLhBc8+iYenP6VbpjYHzgC59zOtOJhSgEojNmbE5c4tafD4RxTKaMCCGkg6WEMAypx8kscdcOwhACSTjFtkddNJFMBMCoCIj0bIq4DKY++wfZwT9SAOOuEQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wNC0yM1QxNDoyMjoyMiswMDowMNu9360AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDQtMjNUMTQ6MjI6MjIrMDA6MDCq4GcRAAAAAElFTkSuQmCC
asSource: true
asTarget: true
uploadPath: /upload/1
uploadPath: /upload?category_id=1
needDoubanInfo: true
seedDomSelector: '#meta-info+.meta-general>.panel:first'
seedDomSelector: '.torrent__buttons+.panelV2'
search:
path: /torrents
replaceKey: ['tt', '']
Expand Down
4 changes: 2 additions & 2 deletions src/source/unit3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default async () => {
.siblings('.table-responsive').find('.panel-body').clone();
descriptionDom.find('#collection_waypoint').remove();
let mediaInfoOrBDInfo = $('.decoda-code code').text();
if (CURRENT_SITE_NAME === 'Blutopia') {
if (CURRENT_SITE_NAME.match(/Blutopia|Aither/i)) {
const title = $('.meta__title').text().trim();
movieName = title.replace(/\(.+\)/g, '');
IMDBYear = title.match(/\((\d{4})\)/)?.[1] ?? '';
Expand Down Expand Up @@ -105,7 +105,7 @@ const getBasicInfo = () => {
Resolution: 'Resolution',
resolution: 'Resolution',
};
if (CURRENT_SITE_NAME !== 'Blutopia') {
if (!CURRENT_SITE_NAME.match(/Blutopia|Aither/i)) {
const lineSelector = $('#meta-info+.meta-general>.panel:has(".table-responsive"):first table tr');
lineSelector.each((index, element) => {
const key = $(element).find('td:first').text().replace(/\s|\n/g, '');
Expand Down
10 changes: 9 additions & 1 deletion src/target/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const fillTargetForm = (info: TorrentInfo.Info) => {
}
}
if (CURRENT_SITE_NAME === 'Concertos') {
$('#add').click();
$('#add').trigger('click');
$('.sceditor-button.sceditor-button-source.has-icon')[0].click();
description = description.replace(mediaInfo.trim(), '');
}
Expand Down Expand Up @@ -249,6 +249,14 @@ const fillTargetForm = (info: TorrentInfo.Info) => {
}, 1000);
}
}

if (CURRENT_SITE_NAME.match(/Blutopia|Aither/)) {
description = description.replace(/\[align(=(.+?))\]((.|\n)+?)\[\/align\]/g, '[$2]$3[/$2]');
description = description.replace(/\[(\/)?hide(?:=(.+?))?\]/g, (match, p1, p2) => {
const slash = p1 || '';
return p2 ? `${p2}: [${slash}spoiler]` : `[${slash}spoiler]`;
});
}
// 过滤空标签
description = filterEmptyTags(description);

Expand Down

0 comments on commit 6fde822

Please sign in to comment.