Skip to content

Commit

Permalink
MEGA links are no longer encrypted. Also added a check to show if the…
Browse files Browse the repository at this point in the history
… link was decrypted when you verify.
  • Loading branch information
fireshaper committed Oct 15, 2020
1 parent 3256f6d commit 7f203a6
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 9 deletions.
49 changes: 40 additions & 9 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private async void btnDownload_ClickAsync(object sender, EventArgs e)
string lastURL = "";
List<string> EVs = new List<string>();

//Get the MEGA link by getting response of download link
//Get the MEGA link by getting response of download link !NOT USED!
/*
using (var client = new HttpClient(new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip }))
{
Expand All @@ -270,11 +270,19 @@ private async void btnDownload_ClickAsync(object sender, EventArgs e)
}
*/

//Get MEGA link by decrypting Base64 string in the address
//Check if the MEGA link is encrypted, decrypt Base64 string if it is
//!--- IT LOOKS LIKE THEY ARE NO LONGER ENCRYPTING THE LINKS, BUT KEEPING THIS IN JUST IN CASE ---!//
string[] comicLinkArray = comicDLLink.Split('/');
string comicLinkEnc = comicLinkArray[4];
byte[] comicLinkConverted = System.Convert.FromBase64String(comicLinkEnc);
megaURL = System.Text.ASCIIEncoding.ASCII.GetString(comicLinkConverted);
if (comicLinkArray[2] != "mega.nz")
{
string comicLinkEnc = comicLinkArray[4];
byte[] comicLinkConverted = System.Convert.FromBase64String(comicLinkEnc);
megaURL = System.Text.ASCIIEncoding.ASCII.GetString(comicLinkConverted);
}
else
{
megaURL = comicDLLink;
}


if (lastURL != megaURL)
Expand Down Expand Up @@ -593,6 +601,11 @@ private void cmsComics_ItemClicked(object sender, ToolStripItemClickedEventArgs

var htmlNodes = doc.DocumentNode.SelectSingleNode("//a[@title='Mega Link']");

if (htmlNodes == null) //Check to see if they just renamed the Node
{
htmlNodes = doc.DocumentNode.SelectSingleNode("//a[@title='MEGA']");
}

if (htmlNodes == null)
{
foreach (HtmlNode node1 in doc.DocumentNode.SelectNodes("//a"))
Expand All @@ -616,6 +629,8 @@ private void cmsComics_ItemClicked(object sender, ToolStripItemClickedEventArgs
comicDLLink = htmlNodes.Attributes["href"].Value;
}

int didDecrypt = 0;

if (comicDLLink != "")
{
//string lastEV = "";
Expand All @@ -624,11 +639,27 @@ private void cmsComics_ItemClicked(object sender, ToolStripItemClickedEventArgs

//Get MEGA link by decrypting Base64 string in the address
string[] comicLinkArray = comicDLLink.Split('/');
string comicLinkEnc = comicLinkArray[4];
byte[] comicLinkConverted = System.Convert.FromBase64String(comicLinkEnc);
megaURL = System.Text.ASCIIEncoding.ASCII.GetString(comicLinkConverted);
if (comicLinkArray[2] != "mega.nz")
{
string comicLinkEnc = comicLinkArray[4];
byte[] comicLinkConverted = System.Convert.FromBase64String(comicLinkEnc);
megaURL = System.Text.ASCIIEncoding.ASCII.GetString(comicLinkConverted);
didDecrypt = 1;
}
else
{
megaURL = comicDLLink;
}

MessageBox.Show("MEGA URL: " + megaURL);
if (didDecrypt == 1)
{
MessageBox.Show("DECRYPTED MEGA URL: " + megaURL);
}
else
{
MessageBox.Show("MEGA URL: " + megaURL);
}


}
else
Expand Down
Binary file modified bin/Debug/Omnibus.exe
Binary file not shown.
Binary file modified bin/Debug/Omnibus.pdb
Binary file not shown.
Binary file modified obj/Debug/Omnibus.exe
Binary file not shown.
Binary file modified obj/Debug/Omnibus.pdb
Binary file not shown.
Binary file modified obj/Release/Omnibus.csproj.GenerateResource.cache
Binary file not shown.
Binary file modified obj/Release/Omnibus.exe
Binary file not shown.
Binary file modified obj/Release/Omnibus.pdb
Binary file not shown.

0 comments on commit 7f203a6

Please sign in to comment.