Skip to content

Commit

Permalink
Merge pull request #12 from kctekn/master
Browse files Browse the repository at this point in the history
修正:unique Id 为空,和描述长度大于Windows最长文件名的情况
  • Loading branch information
K12f authored Dec 17, 2024
2 parents d359a91 + ae8ed85 commit befe0d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/BlueCatKoKo.Ui/Services/DouYinShortVideoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.IO;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Xml;
using BlueCatKoKo.Ui.Constants;
using BlueCatKoKo.Ui.Models;
using Downloader;
Expand Down Expand Up @@ -108,7 +109,7 @@ public async Task<VideoModel> ExtractVideoDataAsync(string url)
Platform = ShortVideoPlatformEnum.DouYin,
VideoId = videoInfoData.AwemeId,
AuthorName = videoInfoData.Author.Nickname,
UniqueId = videoInfoData.Author.UniqueId,
UniqueId = videoInfoData.Author.UniqueId==""?videoInfoData.Author.ShortId:videoInfoData.Author.UniqueId,
AuthorAvatar = videoInfoData.Author.AvatarThumb.UrlList.First().ToString(),
Title = videoInfoData.Author.Signature,
Cover = videoInfoData.Video.Cover.UrlList.Last().ToString(),
Expand Down
3 changes: 2 additions & 1 deletion src/BlueCatKoKo.Ui/ViewModels/Pages/HomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ private async Task DownloadAll()
}

var filepath = _appConfig.Value.DownloadPath;
var filename = "#" + Data.AuthorName + "#" + Data.UniqueId + "# "+ Data.Desc + ".mp4";
var filename = "#" + Data.AuthorName + "#" + Data.UniqueId + "# " + Data.Desc;
filename = filename.Substring(0, Math.Min(250, ("#" + Data.AuthorName + "#" + Data.UniqueId + "# " + Data.Desc).Length))+".mp4";

var replaceFilename = filename.ReplaceInvalidCharacters();

Expand Down

0 comments on commit befe0d4

Please sign in to comment.