Fix some songs not downloading hopefully
This commit is contained in:
@@ -1,33 +0,0 @@
|
|||||||
version: 43
|
|
||||||
jobs:
|
|
||||||
- name: build
|
|
||||||
steps:
|
|
||||||
- type: CheckoutStep
|
|
||||||
name: Checkout code
|
|
||||||
cloneCredential:
|
|
||||||
type: DefaultCredential
|
|
||||||
withLfs: true
|
|
||||||
withSubmodules: true
|
|
||||||
cloneDepth: 1
|
|
||||||
condition: SUCCESSFUL
|
|
||||||
optional: false
|
|
||||||
- type: BuildImageStep
|
|
||||||
name: build image
|
|
||||||
output:
|
|
||||||
type: RegistryOutput
|
|
||||||
tags: onedev.site.tesses.net/tytd2025/tytdcompanion/tytdcompanion:latest
|
|
||||||
registryLogins:
|
|
||||||
- registryUrl: '@server_url@'
|
|
||||||
userName: '@job_token@'
|
|
||||||
passwordSecret: dockersecret
|
|
||||||
condition: SUCCESSFUL
|
|
||||||
optional: false
|
|
||||||
triggers:
|
|
||||||
- type: BranchUpdateTrigger
|
|
||||||
branches: master
|
|
||||||
userMatch: anyone
|
|
||||||
projects: tytd2025/tytdcompanion
|
|
||||||
retryCondition: never
|
|
||||||
maxRetries: 3
|
|
||||||
retryDelay: 30
|
|
||||||
timeout: 14400
|
|
||||||
+9
-6
@@ -17,6 +17,7 @@ using YoutubeExplode.Search;
|
|||||||
using YouTubeMusicAPI.Client;
|
using YouTubeMusicAPI.Client;
|
||||||
using YouTubeMusicAPI.Models.Search;
|
using YouTubeMusicAPI.Models.Search;
|
||||||
using YouTubeMusicAPI.Pagination;
|
using YouTubeMusicAPI.Pagination;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -896,12 +897,14 @@ namespace Tesses.YouTubeDownloader2025Companion
|
|||||||
string path = mId.ToString();
|
string path = mId.ToString();
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
ContentDisposition disposition = new ContentDisposition();
|
string filename = Path.GetFileName(path);
|
||||||
disposition.FileName = Path.GetFileName(path);
|
var cd = new ContentDispositionHeaderValue(inline ? "inline":"attachment");
|
||||||
disposition.Inline = inline;
|
|
||||||
disposition.ModificationDate = File.GetLastWriteTime(path);
|
cd.ModificationDate = File.GetLastWriteTime(path);
|
||||||
disposition.CreationDate = File.GetCreationTime(path);
|
cd.CreationDate = File.GetCreationTime(path);
|
||||||
ctx.ResponseHeaders["Content-Disposition"] = [disposition.ToString()];
|
cd.FileName = filename;
|
||||||
|
cd.FileNameStar = filename; // auto-encodes to RFC 5987
|
||||||
|
ctx.ResponseHeaders["Content-Disposition"] = [cd.ToString()];
|
||||||
await ctx.SendFileAsync(path);
|
await ctx.SendFileAsync(path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user