Skip to content

Commit

Permalink
fix: fixed the issue to correctly handle VideoID that originally star…
Browse files Browse the repository at this point in the history
…ted with `Y`

- Modify the `PlatformType` method in `NameHelper` to check if `videoId` starts with 'Y' before trimming in case of Youtube platform.

Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed Jun 23, 2024
1 parent d623457 commit 696fa69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Helper/NameHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static string PlatformType(string videoId, string platform)
return platform switch
{
"Youtube" or IYtarchiveService.Name or IYtdlpService.Name
=> videoId.TrimStart('Y'),
=> videoId.StartsWith('Y') ? videoId[1..] : videoId,
"Twitch" or IStreamlinkService.Name
=> videoId.StartsWith("TW") ? videoId[2..] : videoId,
"Twitcasting" or ITwitcastingRecorderService.Name
Expand Down

0 comments on commit 696fa69

Please sign in to comment.