Skip to content

Commit

Permalink
fix: ytarchive dockerfile path changed
Browse files Browse the repository at this point in the history
- Added a new key-value entry in the `LivestreamRecorderService.sln.DotSettings` file
- Updated commands in `FC2LiveDLService.cs`, `YtarchiveService.cs` and `YtdlpService.cs` files located in both the `SingletonServices/ACI/Downloader/` and `SingletonServices/Kubernetes/Downloader/` directories. It appears that the commands have been restructured to be more compact.
- Fixed a comment in `YtdlpService.cs` files from "Workground for twitcasting" to "Workaround for twitcasting". The same change has been implemented in both the `SingletonServices/ACI/Downloader/` and `SingletonServices/Kubernetes/Downloader/` directories. This likely improves the understanding of the underlying issue.

Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed May 7, 2024
1 parent 45f2fc6 commit fd0ee78
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 46 deletions.
1 change: 1 addition & 0 deletions LivestreamRecorderService.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=sharedvolume/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=telop/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=twitcasting/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ytarchive/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
12 changes: 4 additions & 8 deletions SingletonServices/ACI/Downloader/FC2LiveDLService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,14 @@ Task<ArmOperation<ArmDeploymentResource>> doWithImage(string imageName)
string[] command = useCookiesFile
?
[
"dumb-init",
"--",
"sh",
"-c",
"dumb-init", "--",
"sh", "-c",
$"fc2-live-dl --latency high --threads 1 -o '{Path.ChangeExtension(filename, ".%(ext)s")}' --log-level trace --cookies /sharedvolume/cookies/{video.ChannelId}.txt 'https://live.fc2.com/{NameHelper.ChangeId.ChannelId.PlatformType(video.ChannelId, Name)}' && mv '/recordings/{filename}' /sharedvolume/"
]
:
[
"dumb-init",
"--",
"sh",
"-c",
"dumb-init", "--",
"sh", "-c",
$"fc2-live-dl --latency high --threads 1 -o '{Path.ChangeExtension(filename, ".%(ext)s")}' --log-level trace 'https://live.fc2.com/{NameHelper.ChangeId.ChannelId.PlatformType(video.ChannelId, Name)}' && mv '/recordings/{filename}' /sharedvolume/"
];

Expand Down
12 changes: 6 additions & 6 deletions SingletonServices/ACI/Downloader/YtarchiveService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ Task<ArmOperation<ArmDeploymentResource>> doWithImage(string imageName)
string[] command = useCookiesFile
?
[
"sh",
"-c",
$"/bin/ytarchive --add-metadata --merge --retry-frags 30 --thumbnail -o '{filename.Replace(".mp4", "")}' -c /sharedvolume/cookies/{video.ChannelId}.txt '{url}' best && mv *.mp4 /sharedvolume/"
"dumb-init", "--",
"sh", "-c",
$"ytarchive --add-metadata --merge --retry-frags 30 --thumbnail -o '{filename.Replace(".mp4", "")}' -c /sharedvolume/cookies/{video.ChannelId}.txt '{url}' best && mv *.mp4 /sharedvolume/"
]
:
[
"sh",
"-c",
$"/bin/ytarchive --add-metadata --merge --retry-frags 30 --thumbnail -o '{filename.Replace(".mp4", "")}' '{url}' best && mv *.mp4 /sharedvolume/"
"dumb-init", "--",
"sh", "-c",
$"ytarchive --add-metadata --merge --retry-frags 30 --thumbnail -o '{filename.Replace(".mp4", "")}' '{url}' best && mv *.mp4 /sharedvolume/"
];

return CreateResourceAsync(
Expand Down
14 changes: 5 additions & 9 deletions SingletonServices/ACI/Downloader/YtdlpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,18 @@ Task<ArmOperation<ArmDeploymentResource>> doWithImage(string imageName)
string[] command = useCookiesFile
?
[
"dumb-init",
"--",
"sh",
"-c",
"dumb-init", "--",
"sh", "-c",
$"yt-dlp --ignore-config --retries 30 --concurrent-fragments 16 --merge-output-format mp4 -S '+proto:http,+codec:h264' --embed-thumbnail --embed-metadata --no-part --cookies /sharedvolume/cookies/{video.ChannelId}.txt -o '{filename}' '{url}' && mv *.mp4 /sharedvolume/"
]
:
[
"dumb-init",
"--",
"sh",
"-c",
"dumb-init", "--",
"sh", "-c",
$"yt-dlp --ignore-config --retries 30 --concurrent-fragments 16 --merge-output-format mp4 -S '+proto:http,+codec:h264' --embed-thumbnail --embed-metadata --no-part -o '{filename}' '{url}' && mv *.mp4 /sharedvolume/"
];

// Workground for twitcasting ERROR: Initialization fragment found after media fragments, unable to download
// Workaround for twitcasting ERROR: Initialization fragment found after media fragments, unable to download
// https://github.com/yt-dlp/yt-dlp/issues/5497
if (url.Contains("twitcasting.tv"))
{
Expand Down
12 changes: 4 additions & 8 deletions SingletonServices/Kubernetes/Downloader/FC2LiveDLService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,14 @@ Task<V1Job> doWithImage(string imageName)
string[] command = useCookiesFile
?
[
"dumb-init",
"--",
"sh",
"-c",
"dumb-init", "--",
"sh", "-c",
$"fc2-live-dl --latency high --threads 1 -o '{Path.ChangeExtension(filename, ".%(ext)s")}' --log-level trace --cookies /sharedvolume/cookies/{video.ChannelId}.txt 'https://live.fc2.com/{NameHelper.ChangeId.ChannelId.PlatformType(video.ChannelId, Name)}' && mv '/recordings/{filename}' /sharedvolume/"
]
:
[
"dumb-init",
"--",
"sh",
"-c",
"dumb-init", "--",
"sh", "-c",
$"fc2-live-dl --latency high --threads 1 -o '{Path.ChangeExtension(filename, ".%(ext)s")}' --log-level trace 'https://live.fc2.com/{NameHelper.ChangeId.ChannelId.PlatformType(video.ChannelId, Name)}' && mv '/recordings/{filename}' /sharedvolume/"
];

Expand Down
12 changes: 6 additions & 6 deletions SingletonServices/Kubernetes/Downloader/YtarchiveService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ Task<V1Job> doWithImage(string imageName)
string[] command = useCookiesFile
?
[
"sh",
"-c",
$"/bin/ytarchive --add-metadata --merge --retry-frags 30 --thumbnail -o '{filename.Replace(".mp4", "")}' -c /sharedvolume/cookies/{video.ChannelId}.txt '{url}' best && mv *.mp4 /sharedvolume/"
"dumb-init", "--",
"sh", "-c",
$"ytarchive --add-metadata --merge --retry-frags 30 --thumbnail -o '{filename.Replace(".mp4", "")}' -c /sharedvolume/cookies/{video.ChannelId}.txt '{url}' best && mv *.mp4 /sharedvolume/"
]
:
[
"sh",
"-c",
$"/bin/ytarchive --add-metadata --merge --retry-frags 30 --thumbnail -o '{filename.Replace(".mp4", "")}' '{url}' best && mv *.mp4 /sharedvolume/"
"dumb-init", "--",
"sh", "-c",
$"ytarchive --add-metadata --merge --retry-frags 30 --thumbnail -o '{filename.Replace(".mp4", "")}' '{url}' best && mv *.mp4 /sharedvolume/"
];

return CreateInstanceAsync(
Expand Down
14 changes: 5 additions & 9 deletions SingletonServices/Kubernetes/Downloader/YtdlpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,18 @@ Task<V1Job> doWithImage(string imageName)
string[] command = useCookiesFile
?
[
"dumb-init",
"--",
"sh",
"-c",
"dumb-init", "--",
"sh", "-c",
$"yt-dlp --ignore-config --retries 30 --concurrent-fragments 16 --merge-output-format mp4 -S '+proto:http,+codec:h264' --embed-thumbnail --embed-metadata --no-part --cookies /sharedvolume/cookies/{video.ChannelId}.txt -o '{filename}' '{url}' && mv *.mp4 /sharedvolume/"
]
:
[
"dumb-init",
"--",
"sh",
"-c",
"dumb-init", "--",
"sh", "-c",
$"yt-dlp --ignore-config --retries 30 --concurrent-fragments 16 --merge-output-format mp4 -S '+proto:http,+codec:h264' --embed-thumbnail --embed-metadata --no-part -o '{filename}' '{url}' && mv *.mp4 /sharedvolume/"
];

// Workground for twitcasting ERROR: Initialization fragment found after media fragments, unable to download
// Workaround for twitcasting ERROR: Initialization fragment found after media fragments, unable to download
// https://github.com/yt-dlp/yt-dlp/issues/5497
if (url.Contains("twitcasting.tv"))
{
Expand Down

0 comments on commit fd0ee78

Please sign in to comment.