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

View File

@ -280,7 +280,7 @@ Public Class CRD_List_Item
If FailedSegments.Count > 0 Then If FailedSegments.Count > 0 Then
For i As Integer = 0 To FailedSegments.Count - 1 For i As Integer = 0 To FailedSegments.Count - 1
Dim ii As Integer = i 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) FailedSegments.RemoveAt(i)
Evaluator.Start() Evaluator.Start()
ThreadList.Add(Evaluator) 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 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) Debug.WriteLine(Folder)
If Not Directory.Exists(Path.GetDirectoryName(Folder)) Then If Not Directory.Exists(Path.GetDirectoryName(Folder)) Then
@ -781,19 +783,38 @@ Public Class CRD_List_Item
sink.WriteLine(InputData) sink.WriteLine(InputData)
End Using 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 Me.Invoke(New Action(Function() As Object
Using sink As New StreamWriter(Folder + "Retry\retry.txt", False, utf8WithoutBom2) Label_websiteText = Label_website.Text
sink.WriteLine(DL_URL) Label_AnimeText = Label_Anime.Text
sink.WriteLine(Label_website.Text) Label_ResoText = Label_Reso.Text
sink.WriteLine(Label_Anime.Text) Label_HardsubText = Label_Hardsub.Text
sink.WriteLine(Label_Reso.Text) Try
sink.WriteLine(Label_Hardsub.Text) PB_Thumbnail.BackgroundImage.Save(Folder + "Retry\retry.jpg")
sink.WriteLine(DateiPfad) Catch ex As Exception
End Using End Try
PB_Thumbnail.BackgroundImage.Save(Folder + "Retry\retry.jpg")
Return Nothing Return Nothing
End Function)) 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) Dim LoadedKeys As New List(Of String)
LoadedKeys.Add("Nothing") LoadedKeys.Add("Nothing")
Dim KeyFileCache As String = Nothing Dim KeyFileCache As String = Nothing
@ -910,6 +931,7 @@ Public Class CRD_List_Item
Return Folder + "\index.m3u8" Return Folder + "\index.m3u8"
End Function End Function
Private Sub TS_DownloadAsync(ByVal DL_URL As String, ByVal DL_Pfad As String) 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 exepath As String = Application.StartupPath + "\ffmpeg.exe"
Dim startinfo As New System.Diagnostics.ProcessStartInfo 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) LogText.Add(Date.Now.ToString + " " + cmd)
If Debug2 = True Then If Debug2 = True Then
MsgBox(cmd) MsgBox(cmd)
@ -1455,8 +1477,8 @@ Public Class CRD_List_Item
Dim logfile As String = DownloadPfad.Replace(Main.VideoFormat, ".log").Replace(Chr(34), "") 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 Catch ex As Exception
MsgBox(ex.ToString) MsgBox(ex.ToString)
End Try End Try
@ -1510,7 +1532,7 @@ Public Class FailedSegemtsWithURL
End Sub End Sub
Public Overrides Function ToString() As String 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 End Function

View File

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

View File

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

View File

@ -22,7 +22,7 @@ Namespace My.Resources
'''<summary> '''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary> '''</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.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _

View File

@ -15,7 +15,7 @@ Option Explicit On
Namespace My Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ <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)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase 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_automatic As String = "[automatic by Series and Season]"
Public SubFolder_automatic2 As String = "[automatic by Series]" Public SubFolder_automatic2 As String = "[automatic by Series]"
Public SubFolder_automatic_old As String = "[automatic: Series/Season]" 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 Public Function GeräteID() As String
Dim rnd As New Random Dim rnd As New Random
Dim possible As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" Dim possible As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"

View File

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

View File

@ -43,7 +43,7 @@
</div> </div>
<h1>Failed!</h1> <h1>Failed!</h1>
<p>System.IndexOutOfRangeException: Der Index war außerhalb des Arraybereichs. <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> </div>
</body> </body>
</html> </html>

View File

@ -18,7 +18,7 @@ Public Class Einstellungen
Private Sub Einstellungen_Load(sender As Object, e As EventArgs) Handles MyBase.Load 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() 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\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\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.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