File tree Expand file tree Collapse file tree 2 files changed +0
-40
lines changed
Expand file tree Collapse file tree 2 files changed +0
-40
lines changed Original file line number Diff line number Diff line change @@ -63,26 +63,6 @@ Console.info(`FORMAT: ${FORMAT}`);
6363 }
6464 case "YouTube" :
6565 Console . info ( "YouTube" ) ;
66- switch ( $response . statusCode ?? $response . status ) {
67- case 200 :
68- break ;
69- // biome-ignore lint/suspicious/noFallthroughSwitchClause: intentional fallthrough to handle error cases
70- case 404 :
71- Console . error ( "请求的字幕不存在,可能是该视频未提供字幕" ) ;
72- // biome-ignore lint/suspicious/noFallthroughSwitchClause: intentional fallthrough to handle error cases
73- case 429 :
74- Console . error ( "请求过于频繁,已被 YouTube 限制访问" ) ;
75- default : {
76- Console . error ( `请求失败,状态码:${ $response . statusCode ?? $response . status } ` ) ;
77- url . searchParams . delete ( "subtype" ) ; // 删除 subtype 参数,避免影响后续请求
78- $request . url = url . toString ( ) ;
79- await fetch ( $request ) . then ( response => {
80- $response . status = response . status ;
81- $response . header = response . header ;
82- $response . body = response . body ;
83- } ) ;
84- }
85- }
8666 switch ( url . searchParams . get ( "tlang" ) ) {
8767 case undefined :
8868 Console . info ( "未选择翻译语言,跳过" ) ;
Original file line number Diff line number Diff line change @@ -63,26 +63,6 @@ Console.info(`FORMAT: ${FORMAT}`);
6363 }
6464 case "YouTube" :
6565 Console . info ( "YouTube" ) ;
66- switch ( $response . statusCode ?? $response . status ) {
67- case 200 :
68- break ;
69- // biome-ignore lint/suspicious/noFallthroughSwitchClause: intentional fallthrough to handle error cases
70- case 404 :
71- Console . error ( "请求的字幕不存在,可能是该视频未提供字幕" ) ;
72- // biome-ignore lint/suspicious/noFallthroughSwitchClause: intentional fallthrough to handle error cases
73- case 429 :
74- Console . error ( "请求过于频繁,已被 YouTube 限制访问" ) ;
75- default : {
76- Console . error ( `请求失败,状态码:${ $response . statusCode ?? $response . status } ` ) ;
77- url . searchParams . delete ( "subtype" ) ; // 删除 subtype 参数,避免影响后续请求
78- $request . url = url . toString ( ) ;
79- await fetch ( $request ) . then ( response => {
80- $response . status = response . status ;
81- $response . header = response . header ;
82- $response . body = response . body ;
83- } ) ;
84- }
85- }
8666 switch ( url . searchParams . get ( "tlang" ) ) {
8767 case undefined :
8868 Console . info ( "未选择翻译语言,跳过" ) ;
You can’t perform that action at this time.
0 commit comments