Commit 16957e13 authored by phanirithvij's avatar phanirithvij
Browse files

n-m3u8dl-re: init at 0.3.0-beta



Co-authored-by: default avatarLuis <luis@caldas.ie>
Co-authored-by: default avatarRebecca Turner <rbt@sent.as>
Signed-off-by: default avatarphanirithvij <phanirithvij2000@gmail.com>
parent 3349acd7
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
[
  {
    "pname": "NiL.JS",
    "version": "2.5.1684",
    "hash": "sha256-lxFTYyuj0SuNzIQGq+rK9s0tAqxqQg8PBj/YdktJunw="
  },
  {
    "pname": "Spectre.Console",
    "version": "0.49.2-preview.0.50",
    "hash": "sha256-ivFyHTfQxPf/RIin+aftmd+G4PcrqmJXmdu0u/RU6YA="
  },
  {
    "pname": "System.CommandLine",
    "version": "2.0.0-beta4.22272.1",
    "hash": "sha256-zSO+CYnMH8deBHDI9DHhCPj79Ce3GOzHCyH1/TiHxcc="
  }
]
+46 −0
Original line number Diff line number Diff line
{
  lib,
  buildDotnetModule,
  fetchFromGitHub,
  dotnetCorePackages,
}:
buildDotnetModule rec {
  pname = "n-m3u8dl-re";
  version = "0.3.0-beta";
  src = fetchFromGitHub {
    owner = "nilaoda";
    repo = "N_m3u8DL-RE";
    tag = "v${version}";
    sha256 = "sha256-AVLO7pxD1LCoogsJPPN5aoOmVBIm3Y/EVsiQWdYI6QU=";
  };
  patches = [
    ./publish-fix.patch
    ./reverse-arr.patch
  ];

  # from openutau/default.nix
  # [...]/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(248,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [[...]/N_m3u8DL-RE.Common.csproj]
  # [...]/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(248,5): error MSB4018: System.IO.IOException: The process cannot access the file '[...]/N_m3u8DL-RE.Common.deps.json' because it is being used by another process. [[...]/N_m3u8DL-RE.Common.csproj]
  enableParallelBuilding = false;

  projectFile = "src/N_m3u8DL-RE.sln";
  nugetDeps = ./deps.json;

  executables = [ "N_m3u8DL-RE" ];

  dotnet-sdk = dotnetCorePackages.sdk_9_0;
  dotnet-runtime = dotnetCorePackages.runtime_9_0;

  postFixup = ''
    ln -s $out/bin/N_m3u8DL-RE $out/bin/n-m3u8dl-re
  '';

  meta = {
    description = "Cross-Platform, modern and powerful stream downloader for MPD/M3U8/ISM";
    homepage = "https://github.com/nilaoda/N_m3u8DL-RE";
    license = lib.licenses.mit;
    mainProgram = "n-m3u8dl-re";
    maintainers = with lib.maintainers; [ phanirithvij ];
    platforms = lib.platforms.linux ++ lib.platforms.unix;
  };
}
+10 −0
Original line number Diff line number Diff line
--- a/src/N_m3u8DL-RE/Directory.Build.props
+++ b/src/N_m3u8DL-RE/Directory.Build.props
@@ -9,7 +9,6 @@
     <IlcTrimMetadata>true</IlcTrimMetadata>
     <IlcGenerateStackTraceData>true</IlcGenerateStackTraceData>
     <SatelliteResourceLanguages>zh-CN;zh-TW;en-US</SatelliteResourceLanguages>
-    <PublishAot>true</PublishAot>
     <StripSymbols>true</StripSymbols>
     <ObjCopyName Condition="'$(RuntimeIdentifier)' == 'linux-arm64' or '$(RuntimeIdentifier)' == 'linux-musl-arm64'">aarch64-linux-gnu-objcopy</ObjCopyName>
   </PropertyGroup>
+42 −0
Original line number Diff line number Diff line
diff --git a/src/N_m3u8DL-RE.Common/Entity/WebVttSub.cs b/src/N_m3u8DL-RE.Common/Entity/WebVttSub.cs
index 6b6d284..b57fc24 100644
--- a/src/N_m3u8DL-RE.Common/Entity/WebVttSub.cs
+++ b/src/N_m3u8DL-RE.Common/Entity/WebVttSub.cs
@@ -201,7 +201,8 @@ public partial class WebVttSub
             time += Convert.ToInt32(parts.Last().PadRight(3, '0'));
             str = parts.First();
         }
-        var t = str.Split(':').Reverse().ToList();
+        var t = str.Split(':').ToList();
+        t.Reverse();
         for (int i = 0; i < t.Count; i++)
         {
             time += (long)Math.Pow(60, i) * Convert.ToInt32(t[i]) * 1000;
@@ -265,4 +266,4 @@ public partial class WebVttSub
 
         return srt;
     }
-}
\ No newline at end of file
+}
diff --git a/src/N_m3u8DL-RE/Util/OtherUtil.cs b/src/N_m3u8DL-RE/Util/OtherUtil.cs
index b2487f3..4eab23f 100644
--- a/src/N_m3u8DL-RE/Util/OtherUtil.cs
+++ b/src/N_m3u8DL-RE/Util/OtherUtil.cs
@@ -70,7 +70,8 @@ internal static partial class OtherUtil
         var hours = -1;
         var mins = -1;
         var secs = -1;
-        arr.Reverse().Select(i => Convert.ToInt32(i)).ToList().ForEach(item =>
+        arr.Reverse();
+        arr.Select(i => Convert.ToInt32(i)).ToList().ForEach(item =>
         {
             if (secs == -1) secs = item;
             else if (mins == -1) mins = item;
@@ -170,4 +171,4 @@ internal static partial class OtherUtil
 
     [GeneratedRegex(@"^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$")]
     private static partial Regex TimeStrRegex();
-}
\ No newline at end of file
+}