long path support

added long path support
This commit is contained in:
hama3254 2022-01-22 11:56:37 +01:00
parent ae052df422
commit c243deb996
29 changed files with 96 additions and 30 deletions

View File

@ -0,0 +1,11 @@
{
"Version": 1,
"ProjectMap": {
"9b604819-2db7-4be1-ba43-43babebb5ec3": {
"ProjectGuid": "9b604819-2db7-4be1-ba43-43babebb5ec3",
"DisplayName": "Crunchyroll Downloader",
"ColorIndex": 0
}
},
"NextColorIndex": 1
}

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

View File

@ -280,7 +280,7 @@ Public Class CRD_List_Item
If FailedSegments.Count > 0 Then
For i As Integer = 0 To FailedSegments.Count - 1
Dim ii As Integer = i
Dim Evaluator = New Thread(Sub() Me.TS_DownloadAsync(FailedSegments.Item(ii).url, FailedSegments.Item(ii).path))
Dim Evaluator = New Thread(Sub() Me.TS_DownloadAsync(FailedSegments.Item(ii).Url, FailedSegments.Item(ii).Path))
FailedSegments.RemoveAt(i)
Evaluator.Start()
ThreadList.Add(Evaluator)
@ -751,6 +751,8 @@ Public Class CRD_List_Item
Private Function ProcessV3(ByVal url As String, ByVal InputData As String, ByVal Folder As String, ByVal DateiPfad As String, ByVal DL_URL As String) As String
Debug.WriteLine(Folder)
If Not Directory.Exists(Path.GetDirectoryName(Folder)) Then
@ -781,19 +783,38 @@ Public Class CRD_List_Item
sink.WriteLine(InputData)
End Using
Dim Label_websiteText As String = Nothing
Dim Label_AnimeText As String = Nothing
Dim Label_ResoText As String = Nothing
Dim Label_HardsubText As String = Nothing
Me.Invoke(New Action(Function() As Object
Using sink As New StreamWriter(Folder + "Retry\retry.txt", False, utf8WithoutBom2)
sink.WriteLine(DL_URL)
sink.WriteLine(Label_website.Text)
sink.WriteLine(Label_Anime.Text)
sink.WriteLine(Label_Reso.Text)
sink.WriteLine(Label_Hardsub.Text)
sink.WriteLine(DateiPfad)
End Using
PB_Thumbnail.BackgroundImage.Save(Folder + "Retry\retry.jpg")
Label_websiteText = Label_website.Text
Label_AnimeText = Label_Anime.Text
Label_ResoText = Label_Reso.Text
Label_HardsubText = Label_Hardsub.Text
Try
PB_Thumbnail.BackgroundImage.Save(Folder + "Retry\retry.jpg")
Catch ex As Exception
End Try
Return Nothing
End Function))
Using sink As New StreamWriter(Folder + "Retry\retry.txt", False, utf8WithoutBom2)
sink.WriteLine(DL_URL)
sink.WriteLine(Label_websiteText)
sink.WriteLine(Label_AnimeText)
sink.WriteLine(Label_ResoText)
sink.WriteLine(Label_HardsubText)
sink.WriteLine(DateiPfad)
End Using
Dim LoadedKeys As New List(Of String)
LoadedKeys.Add("Nothing")
Dim KeyFileCache As String = Nothing
@ -910,6 +931,7 @@ Public Class CRD_List_Item
Return Folder + "\index.m3u8"
End Function
Private Sub TS_DownloadAsync(ByVal DL_URL As String, ByVal DL_Pfad As String)
@ -1145,7 +1167,7 @@ Public Class CRD_List_Item
Dim exepath As String = Application.StartupPath + "\ffmpeg.exe"
Dim startinfo As New System.Diagnostics.ProcessStartInfo
Dim cmd As String = "-user-agent " + My.Resources.ffmpeg_user_agend.Replace("User-Agent: ", "") + " -headers " + Chr(34) + "ACCEPT-ENCODING: *" + Chr(34) + " " + DLCommand + " " + DL_Pfad 'start ffmpeg with command strFFCMD string
Dim cmd As String = "-user_agent " + My.Resources.ffmpeg_user_agend.Replace("User-Agent: ", "") + " -headers " + Chr(34) + "ACCEPT-ENCODING: *" + Chr(34) + " " + DLCommand + " " + DL_Pfad 'start ffmpeg with command strFFCMD string
LogText.Add(Date.Now.ToString + " " + cmd)
If Debug2 = True Then
MsgBox(cmd)
@ -1455,8 +1477,8 @@ Public Class CRD_List_Item
Dim logfile As String = DownloadPfad.Replace(Main.VideoFormat, ".log").Replace(Chr(34), "")
File.WriteAllText(logfile, HybrideLog)
'File.WriteAllText(logfile, HybrideLog)
WriteText(logfile, HybrideLog)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
@ -1510,7 +1532,7 @@ Public Class FailedSegemtsWithURL
End Sub
Public Overrides Function ToString() As String
Return String.Format("{0}, {1}", Me.path, Me.url)
Return String.Format("{0}, {1}", Me.Path, Me.Url)
End Function

View File

@ -14,7 +14,7 @@
<AssemblyName>Crunchyroll Downloader</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>WindowsForms</MyType>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
@ -211,6 +211,7 @@
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>

View File

@ -709,6 +709,13 @@ Public Class Main
If CBool(InStr(URL_DL, ".mpd")) Then
TempHybridMode = False
End If
If Pfad_DL.Length > 255 Then
MsgBox(Pfad_DL.Length.ToString)
Pfad_DL = Chr(34) + "\\?\" + Pfad_DL.Replace(Chr(34), "") + Chr(34)
End If
'MsgBox(URL_DL + vbNewLine + Pfad_DL + vbNewLine + NameKomplett + vbNewLine + TempHybridMode.ToString)
Item.StartDownload(URL_DL, Pfad_DL, NameKomplett, TempHybridMode)
End Sub
@ -1426,7 +1433,8 @@ Public Class Main
End If
Dim Pfad4 As String = Path.Combine(Path.GetDirectoryName(Pfad3), FN)
'MsgBox(Pfad4)
File.WriteAllText(Pfad4, str0, Encoding.UTF8)
'File.WriteAllText(Pfad4, str0, Encoding.UTF8)
WriteText(Pfad4, str0)
Pause(3)
Next
End If
@ -1956,7 +1964,8 @@ Public Class Main
End If
Dim Pfad4 As String = Path.Combine(Path.GetDirectoryName(Pfad3), FN)
'MsgBox(Pfad4)
File.WriteAllText(Pfad4, str0, Encoding.UTF8)
'File.WriteAllText(Pfad4, str0, Encoding.UTF8)
WriteText(Pfad4, str0)
Pause(3)
Next
End If
@ -2467,7 +2476,8 @@ Public Class Main
End If
Dim Pfad4 As String = Path.Combine(Path.GetDirectoryName(Pfad3), FN)
'MsgBox(Pfad4)
File.WriteAllText(Pfad4, str0, Encoding.UTF8)
'File.WriteAllText(Pfad4, str0, Encoding.UTF8)
WriteText(Pfad4, str0)
Pause(3)
Next
End If
@ -4099,7 +4109,8 @@ Public Class Main
Dim Pfad4 As String = Path.Combine(Path.GetDirectoryName(Pfad3), FN)
'MsgBox(Pfad4)
Debug.WriteLine(Pfad4)
File.WriteAllText(Pfad4, Subfile, Encoding.UTF8)
'File.WriteAllText(Pfad4, Subfile, Encoding.UTF8)
WriteText(Pfad4, Subfile)
Pause(1)
Next
End If
@ -4581,8 +4592,8 @@ Public Class Main
End Sub
Sub ProcessRequest(ByVal stream As NetworkStream, ByVal htmlReq As String)
' Debug.WriteLine(htmlReq)
Dim recvBytes(1048576) As Byte
Debug.WriteLine(htmlReq)
' Dim recvBytes(1048576) As Byte
Try
Dim rootPath As String = Directory.GetCurrentDirectory() & "\WebInterface\"
' Set default page

View File

@ -22,7 +22,7 @@ Namespace My.Resources
'''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _

View File

@ -15,7 +15,7 @@ Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0"), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase

View File

@ -1,4 +1,7 @@
Module Subfolder
Imports System.IO
Imports System.Text
Module Subfolder
Public SubFolder_automatic As String = "[automatic by Series and Season]"
Public SubFolder_automatic2 As String = "[automatic by Series]"
Public SubFolder_automatic_old As String = "[automatic: Series/Season]"
@ -34,6 +37,16 @@
Public Sub WriteText(ByVal Pfad As String, ByVal Content As String)
If Pfad.Length > 255 Then
Pfad = "\\?\" + Pfad
End If
File.WriteAllText(Pfad, Content, Encoding.UTF8)
End Sub
Public Function GeräteID() As String
Dim rnd As New Random
Dim possible As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

View File

@ -43,7 +43,7 @@
</div>
<h1>Failed!</h1>
<p>System.IndexOutOfRangeException: Der Index war außerhalb des Arraybereichs.
bei Crunchyroll_Downloader.Main.ProcessRequest(NetworkStream stream, String htmlReq) in D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - CefSharp\Crunchyroll Downloader\Main.vb:Zeile 4577.</p>
bei Crunchyroll_Downloader.Main.ProcessRequest(NetworkStream stream, String htmlReq) in D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - CefSharp\Crunchyroll Downloader\Main.vb:Zeile 4584.</p>
</div>
</body>
</html>

View File

@ -18,7 +18,7 @@ Public Class Einstellungen
Private Sub Einstellungen_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label6.Text = "You have: v" + Application.ProductVersion.ToString + " Chromium-U11"
Label6.Text = "You have: v" + Application.ProductVersion.ToString + " Chromium-U11-LongPathTest"
BackgroundWorker1.RunWorkerAsync()

View File

@ -0,0 +1,7 @@
' <autogenerated/>
Option Strict Off
Option Explicit On
Imports System
Imports System.Reflection
<Assembly: Global.System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName:=".NET Framework 4.8")>

View File

@ -1 +1 @@
352c1818320c95c3e555a1345e2f4cce77e2ebb1
1dd5e29241b2f4d85699258dc136faba2410d329

View File

@ -106,4 +106,5 @@ D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - Ce
D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - CefSharp\Crunchyroll Downloader\obj\x64\Debug\Crunchyroll Downloader.pdb
D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - CefSharp\Crunchyroll Downloader\bin\x64\Debug\libcef.dll
D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - CefSharp\Crunchyroll Downloader\obj\x64\Debug\Crunchyroll_Downloader.ErrorBrowser.resources
D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - CefSharp\Crunchyroll Downloader\obj\x64\Debug\Crunchyroll Downloader.vbprojAssemblyReference.cache
D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - CefSharp\Crunchyroll Downloader\obj\x64\Debug\Crunchyroll Downloader.vbproj.AssemblyReference.cache
D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - CefSharp\Crunchyroll Downloader\obj\x64\Debug\Crunchyroll Downloader.vbproj.SuggestedBindingRedirects.cache