Added Funimation

Added Funimation
This commit is contained in:
hama3254 2020-07-12 17:52:13 +02:00
parent ec3f0b3bbe
commit c1bcb32832
22 changed files with 279 additions and 13 deletions

Binary file not shown.

View File

@ -273,9 +273,9 @@ Partial Class Anime_Add
Me.ClientSize = New System.Drawing.Size(630, 275)
Me.Controls.Add(Me.pictureBox3)
Me.Controls.Add(Me.pictureBox4)
Me.Controls.Add(Me.groupBox1)
Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.groupBox2)
Me.Controls.Add(Me.groupBox1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "Anime_Add"
Me.Text = "Add"

View File

@ -194,7 +194,7 @@ Public Class Anime_Add
Main.LoginOnly = "Download Mode!"
If groupBox1.Visible = True Then
Try
If CBool(InStr(textBox1.Text, "crunchyroll.com")) Then
If CBool(InStr(textBox1.Text, "crunchyroll.com")) Or CBool(InStr(textBox1.Text, "funimation.com")) Then
If StatusLabel.Text = "Status: waiting for episode selection" Then
If MessageBox.Show("Are you sure you want cancel the advanced download?", "confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
StatusLabel.Text = "Status: idle"
@ -402,13 +402,25 @@ Public Class Anime_Add
If Main.RunningDownloads < Main.MaxDL Then
If ListBox1.Items.Count > 0 Then
If GroupBox3.Visible = True Then
If Main.Grapp_RDY = True Then
GeckoFX.WebBrowser1.Navigate(ListBox1.GetItemText(ListBox1.Items(0)))
ListBox1.Items.Remove(ListBox1.Items(0))
Main.Grapp_RDY = False
Main.b = False
If InStr(ListBox1.GetItemText(ListBox1.Items(0)), "funimation.com") Then
If Main.Funimation_Grapp_RDY = True Then
GeckoFX.WebBrowser1.Navigate(ListBox1.GetItemText(ListBox1.Items(0)))
ListBox1.Items.Remove(ListBox1.Items(0))
Main.Funimation_Grapp_RDY = False
Main.b = False
End If
Else
If Main.Grapp_RDY = True Then
GeckoFX.WebBrowser1.Navigate(ListBox1.GetItemText(ListBox1.Items(0)))
ListBox1.Items.Remove(ListBox1.Items(0))
Main.Grapp_RDY = False
Main.b = False
End If
End If
End If
End If
End If

View File

@ -26,6 +26,7 @@ Partial Class GeckoFX
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'WebBrowser1
@ -42,14 +43,14 @@ Partial Class GeckoFX
'
Me.TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox1.Location = New System.Drawing.Point(289, 1)
Me.TextBox1.Location = New System.Drawing.Point(418, 1)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(988, 26)
Me.TextBox1.Size = New System.Drawing.Size(859, 26)
Me.TextBox1.TabIndex = 1
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(187, 1)
Me.Button1.Location = New System.Drawing.Point(316, 1)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(96, 26)
Me.Button1.TabIndex = 2
@ -59,18 +60,28 @@ Partial Class GeckoFX
'Button2
'
Me.Button2.Enabled = False
Me.Button2.Location = New System.Drawing.Point(3, 2)
Me.Button2.Location = New System.Drawing.Point(132, 1)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(178, 26)
Me.Button2.TabIndex = 3
Me.Button2.Text = "Start network scan"
Me.Button2.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(2, 2)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(126, 26)
Me.Button3.TabIndex = 4
Me.Button3.Text = "Funimation"
Me.Button3.UseVisualStyleBackColor = True
'
'GeckoFX
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1279, 750)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox1)
@ -90,4 +101,5 @@ Partial Class GeckoFX
Friend WithEvents TextBox1 As TextBox
Friend WithEvents Button1 As Button
Friend WithEvents Button2 As Button
Friend WithEvents Button3 As Button
End Class

View File

@ -132,11 +132,13 @@ Public Class GeckoFX
Main.MassGrapp()
End If
Else
Main.b = True
MsgBox(Main.No_Stream, MsgBoxStyle.OkOnly)
Anime_Add.StatusLabel.Text = "Status: idle"
End If
Catch ex As Exception
MsgBox(ex.ToString)
Main.LabelUpdate = "Status: idle"
Anime_Add.StatusLabel.Text = "Status: idle"
End Try
ElseIf Main.c = False Then
If CBool(InStr(WebBrowser1.Document.Body.OuterHtml, "hardsub_lang")) Then
@ -157,7 +159,32 @@ Public Class GeckoFX
Me.Close()
End If
'ElseIf CBool(InStr(WebBrowser1.Url.ToString, "https://www.anime-on-demand.de/anime/")) Then
ElseIf CBool(InStr(WebBrowser1.Url.ToString, "funimation.com/player")) Then
'todo softsub download
Dim SubTitle1() As String = WebBrowser1.Document.Body.OuterHtml.Split(New String() {".srt"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim SubTitle2() As String = SubTitle1(0).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Main.WebbrowserSoftSubURL = SubTitle2(SubTitle2.Count - 1) + ".srt"
'MsgBox(Main.WebbrowserSoftSubURL)
' Anime_Add.StatusLabel.Text =
ElseIf CBool(InStr(WebBrowser1.Url.ToString, "funimation.com")) Then
If Main.b = False Then
If InStr(WebBrowser1.Document.Body.OuterHtml, My.Resources.Funimation_Player_ID) Then
Main.WebbrowserURL = WebBrowser1.Url.ToString
Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml
Main.WebbrowserTitle = WebBrowser1.DocumentTitle
Main.WebbrowserHeadText = WebBrowser1.Document.Head.InnerHtml
Main.b = True
t = New Thread(AddressOf Main.Funitmation_Grapp)
t.Priority = ThreadPriority.Normal
t.IsBackground = True
t.Start()
Else
Anime_Add.StatusLabel.Text = "fail?"
End If
End If
Else
If Main.b = False Then
@ -377,6 +404,8 @@ Public Class GeckoFX
'Main.GrappURL()
Try
My.Computer.Clipboard.SetText(WebBrowser1.Url.ToString)
'My.Computer.Clipboard.SetText(WebBrowser1.Document.Head.InnerHtml)
MsgBox("copied: " + Chr(34) + WebBrowser1.Url.ToString + Chr(34))
Catch ex As Exception
End Try
@ -652,4 +681,20 @@ Public Class GeckoFX
'Debug_Mode.TopMost = False
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If InStr(WebBrowser1.Url.ToString, "funimation.com") Then
Dim Funimation_List As New List(Of String)
Dim Funimation_list1() As String = WebBrowser1.Document.Body.OuterHtml.Split(New String() {My.Resources.Funimation_Split_1}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 1 To Funimation_list1.Count - 1
Dim Funimation_list2() As String = Funimation_list1(i).Split(New String() {My.Resources.Funimation_Split_2}, System.StringSplitOptions.RemoveEmptyEntries)
Funimation_List.Add("https://www.funimation.com" + Funimation_list2(0))
Main.ListBoxList.Add("https://www.funimation.com" + Funimation_list2(0))
Next
MsgBox(Funimation_List.Count.ToString + " episodes added to Download queue")
'For ii As Integer = 0 To Funimation_List.Count - 1
' MsgBox(Funimation_List.Item(ii))
'Next
End If
End Sub
End Class

View File

@ -51,11 +51,14 @@ Public Class Main
Dim URL_DL As String
Dim Pfad_DL As String
Public Grapp_RDY As Boolean = True
Public Funimation_Grapp_RDY As Boolean = True
Public Grapp_non_cr_RDY As Boolean = True
Public Grapp_Abord As Boolean = False
Public MaxDL As Integer
Public ResoNotFoundString As String
Public ResoBackString As String
Public WebbrowserHeadText As String = Nothing
Public WebbrowserSoftSubURL As String = Nothing
Public WebbrowserURL As String = Nothing
Public WebbrowserText As String = Nothing
Public WebbrowserTitle As String = Nothing
@ -67,7 +70,7 @@ Public Class Main
Dim DL_Path_String As String = "Please choose download directory."
Public CR_Premium_Failed As String = "Can not verify the active premium membership."
Public No_Stream As String = "Please make sure that the URL is correct."
Public No_Stream As String = "Please make sure that the URL is correct or check if the Anime is available in your country."
Dim TaskNotCompleed As String = "Please wait until the current task is completed."
Dim Premium_Stream As String = "Please make sure that you logged in for this premium episode."
Dim Error_Mass_DL As String = "We run into a problem here." + vbNewLine + "You can try to download every episode individually."
@ -1824,4 +1827,83 @@ Public Class Main
End Try
FontLabel2.Text = RunningDownloads.ToString
End Sub
Public Sub Funitmation_Grapp()
Try
Funimation_Grapp_RDY = False
#Region "Name"
Dim FunimationName() As String = WebbrowserText.Split(New String() {"</h1>"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim FunimationName2() As String = FunimationName(0).Split(New String() {Chr(34) + ">"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim FunimationName3 As String = FunimationName2(FunimationName2.Count - 1).Replace("</a>", "")
#End Region
#Region "m3u8 URL"
Dim Player_ID() As String = WebbrowserText.Split(New String() {My.Resources.Funimation_Player_ID}, System.StringSplitOptions.RemoveEmptyEntries)
Dim Player_ID2() As String = Player_ID(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim iFrameURL As String = "https://www.funimation.com/player/" + Player_ID2(0) + "/?bdub=0&qid="
WebbrowserSoftSubURL = Nothing
Me.Invoke(New Action(Function()
Anime_Add.StatusLabel.Text = iFrameURL
GeckoFX.WebBrowser1.Navigate(iFrameURL)
Return Nothing
End Function))
Dim client0 As New WebClient
client0.Encoding = Encoding.UTF8
Dim str0 As String = client0.DownloadString("https://www.funimation.com/api/showexperience/" + Player_ID2(0) + "/?pinst_id=fzQc9p9f")
Dim Funimation_m3u8() As String = str0.Split(New String() {My.Resources.Funimation_src_string}, System.StringSplitOptions.RemoveEmptyEntries)
Dim Funimation_m3u8_final As String = Nothing
Dim Funimation_m3u8_Main As String = Nothing
For i As Integer = 0 To Funimation_m3u8.Count - 1
If InStr(Funimation_m3u8(i), "m3u8?") Then
Dim Funimation_m3u8_split() As String = Funimation_m3u8(i).Split(New String() {", "}, System.StringSplitOptions.RemoveEmptyEntries)
Funimation_m3u8_Main = Funimation_m3u8_split(0)
Exit For
End If
Next
Dim str1 As String = client0.DownloadString(Funimation_m3u8_Main.Replace(Chr(34), ""))
Dim textLenght() As String = str1.Split(New String() {vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 0 To textLenght.Length - 1
If InStr(textLenght(i), "https") Then
If InStr(textLenght(i - 1), "x" + Resu.ToString) Then
Funimation_m3u8_final = textLenght(i)
Exit For
End If
End If
Next
'
'MsgBox(FunimationName3)
'MsgBox(Funimation_m3u8_final)
#Region "thumbnail"
Dim thumbnail As String() = WebbrowserHeadText.Split(New String() {My.Resources.Funimation_thumbnail}, System.StringSplitOptions.RemoveEmptyEntries)
Dim thumbnail2 As String() = thumbnail(1).Split(New String() {Chr(34) + ">"}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
Dim thumbnail3 As String = thumbnail2(0) '.Replace("\/", "/")
#End Region
Dim ResoHTMLDisplay As String = Resu.ToString + "p"
Dim DownloadPfad As String = Chr(34) + Pfad + "\" + FunimationName3 + ".mp4" + Chr(34)
Dim L1Name_Split As String() = WebbrowserURL.Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim L1Name As String = L1Name_Split(1).Replace("www.", "")
Me.Invoke(New Action(Function()
ListItemAdd(Pfad_DL, L1Name, FunimationName3, ResoHTMLDisplay, "Unknown", SubValuesToDisplay(), thumbnail3, Funimation_m3u8_final, DownloadPfad)
Return Nothing
End Function))
#End Region
If WebbrowserSoftSubURL = Nothing Then
Else
Dim str2 As String = client0.DownloadString(WebbrowserSoftSubURL)
Dim Pfad3 As String = DownloadPfad.Replace(Chr(34), "")
Dim Pfad4 As String = Pfad3.Replace(".mp4", ".srt")
File.WriteAllText(Pfad4, str2, Encoding.UTF8)
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Funimation_Grapp_RDY = True
End Sub
End Class

View File

@ -267,6 +267,51 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die src=&quot;/player/ ähnelt.
'''</summary>
Friend ReadOnly Property Funimation_Player_ID() As String
Get
Return ResourceManager.GetString("Funimation_Player_ID", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;a class=&quot;trackVideo ng-binding&quot; href=&quot; ähnelt.
'''</summary>
Friend ReadOnly Property Funimation_Split_1() As String
Get
Return ResourceManager.GetString("Funimation_Split_1", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &quot;&gt; ähnelt.
'''</summary>
Friend ReadOnly Property Funimation_Split_2() As String
Get
Return ResourceManager.GetString("Funimation_Split_2", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &quot;src&quot;: ähnelt.
'''</summary>
Friend ReadOnly Property Funimation_src_string() As String
Get
Return ResourceManager.GetString("Funimation_src_string", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;meta property=&quot;og:image&quot; content=&quot; ähnelt.
'''</summary>
Friend ReadOnly Property Funimation_thumbnail() As String
Get
Return ResourceManager.GetString("Funimation_thumbnail", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &quot;,&quot;resolution&quot;:&quot;adaptive&quot; ähnelt.
'''</summary>

View File

@ -370,4 +370,19 @@ I delete the curremt session with the unlock, if you want to be logged in with t
<data name="main_settings_hover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\main-settings_hover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Funimation_Player_ID" xml:space="preserve">
<value>src="/player/</value>
</data>
<data name="Funimation_Split_1" xml:space="preserve">
<value>&lt;a class="trackVideo ng-binding" href="</value>
</data>
<data name="Funimation_Split_2" xml:space="preserve">
<value>"&gt;</value>
</data>
<data name="Funimation_src_string" xml:space="preserve">
<value>"src":</value>
</data>
<data name="Funimation_thumbnail" xml:space="preserve">
<value>&lt;meta property="og:image" content="</value>
</data>
</root>

View File

@ -3,4 +3,9 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
</configuration>

View File

@ -127,6 +127,31 @@ Crunchyroll Downloader
Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_Player_ID">
<summary>
Sucht eine lokalisierte Zeichenfolge, die src=&quot;/player/ ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_Split_1">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &lt;a class=&quot;trackVideo ng-binding&quot; href=&quot; ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_Split_2">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &quot;&gt; ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_src_string">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &quot;src&quot;: ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_thumbnail">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &lt;meta property=&quot;og:image&quot; content=&quot; ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.hls_endString">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &quot;,&quot;resolution&quot;:&quot;adaptive&quot; ähnelt.

View File

@ -127,6 +127,31 @@ Crunchyroll Downloader
Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_Player_ID">
<summary>
Sucht eine lokalisierte Zeichenfolge, die src=&quot;/player/ ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_Split_1">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &lt;a class=&quot;trackVideo ng-binding&quot; href=&quot; ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_Split_2">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &quot;&gt; ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_src_string">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &quot;src&quot;: ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.Funimation_thumbnail">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &lt;meta property=&quot;og:image&quot; content=&quot; ähnelt.
</summary>
</member>
<member name="P:Crunchyroll_Downloader.My.Resources.Resources.hls_endString">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &quot;,&quot;resolution&quot;:&quot;adaptive&quot; ähnelt.

BIN
icon.xcf

Binary file not shown.