Skip to content

Commit

Permalink
Merge pull request #387 from caorushizi/fix/bug
Browse files Browse the repository at this point in the history
Fix some bug
  • Loading branch information
caorushizi authored Jan 1, 2025
2 parents 061ffc9 + 594a3f8 commit f2a6383
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 13 deletions.
5 changes: 2 additions & 3 deletions packages/backend/src/helper/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const biliDownloaderBin = resolveBin("BBDown");
export const m3u8DownloaderBin = resolveBin("N_m3u8DL-RE");

// user agent
export const pcUA =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36";
export const pcUA = "";
export const mobileUA =
"Mozilla/5.0 (Linux; Android 8.0.0; SM-G955U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36";
"Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G973U) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/14.2 Chrome/87.0.4280.141 Mobile Safari/537.36";
3 changes: 3 additions & 0 deletions packages/backend/src/services/DownloadService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ const processList: Schema[] = [
localDir: {
argsName: ["--work-dir"],
},
name: {
argsName: ["--file-pattern"],
},
},
consoleReg: {
speed: "([\\d.]+\\s[GMK]B/s)",
Expand Down
Binary file modified packages/main/bin/darwin/arm64/N_m3u8DL-RE
Binary file not shown.
Binary file modified packages/main/bin/darwin/x64/N_m3u8DL-RE
Binary file not shown.
Binary file modified packages/main/bin/linux/x64/BBDown
Binary file not shown.
Binary file modified packages/main/bin/linux/x64/N_m3u8DL-RE
Binary file not shown.
Binary file modified packages/main/bin/win32/x64/BBDown.exe
Binary file not shown.
Binary file modified packages/main/bin/win32/x64/N_m3u8DL-RE.exe
Binary file not shown.
5 changes: 2 additions & 3 deletions packages/main/src/helper/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const pluginPath = resolveStatic("plugin/index.js");
export const mobileDir = resolveStatic("mobile");

// user agent
export const pcUA =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36";
export const pcUA = "";
export const mobileUA =
"Mozilla/5.0 (Linux; Android 8.0.0; SM-G955U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36";
"Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G973U) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/14.2 Chrome/87.0.4280.141 Mobile Safari/537.36";
3 changes: 3 additions & 0 deletions packages/main/src/services/DownloadService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ const processList: Schema[] = [
localDir: {
argsName: ["--work-dir"],
},
name: {
argsName: ["--file-pattern"],
},
},
consoleReg: {
speed: "([\\d.]+\\s[GMK]B/s)",
Expand Down
8 changes: 7 additions & 1 deletion packages/main/src/services/WebviewService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export default class WebviewService {
preload: resolve(__dirname, "./preload.js"),
},
});

if (isDev) {
this.view.webContents.openDevTools();
}

this.view.setBackgroundColor("#fff");
const { isMobile, audioMuted } = this.store.store;
this.setAudioMuted(audioMuted);
Expand Down Expand Up @@ -111,7 +116,8 @@ export default class WebviewService {
};

onDidFailLoad = (e: Event, code: number, desc: string) => {
this.window.webContents.send("webview-fail-load", { code, desc });
// this.window.webContents.send("webview-fail-load", { code, desc });
this.logger.error(`[Webview] fail load: ${code} ${desc}`);
};

onDidNavigateInPage = () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/renderer/src/components/EpisodeNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ export const EpisodeNumber: FC<EpisodeNumberProps> = ({
/**
* initialize
* This component is used in three places
* 1. Create a new download: value is empty
* 2. Edit download: value There is a value, edit mode, yes以使用 canChangeType 判断是否为编辑模式
* 3. Video sniffing: value Has a value, but is not in edit mode式
* 1. Create a new download
* 2. Edit download
* 3. Video sniffing
*/
useEffect(() => {
// If not, use the last value
if (!value) {
if (value == null) {
const name = lastVideoName || "";
const number = lastVideoNumber || 1;
const type = lastVideoType || "movie";
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/src/renderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare interface DownloadItem {
isLive?: boolean;
log?: string;
folder?: string;
createdDate?: Date;
createdDate?: string;
}

declare interface VideoResponse {
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function moment() {
}

export function fromatDateTime(
d: Date,
d: string | number | Date,
tmpStr: string = "YYYY/MM/DD HH:mm:ss",
) {
return dayjs(d).format(tmpStr);
Expand Down

0 comments on commit f2a6383

Please sign in to comment.