/// <summary> /// Downloads the specified subtitle from subscene. /// </summary> /// <param name="url">The URL of the subtitle page.</param> /// <param name="target">The target location.</param> /// <param name="token">The user token.</param> private void InternalDownload(string url, string target, string token) { // get the info page var info = Utils.GetHTML(url); DownloadProgressChanged.Fire(this, 25); // extract the download link var dllink = "http://simple.podnapisi.net" + info.DocumentNode.GetNodeAttributeValue("//img[@title='Download']/..", "href"); if (dllink == "http://simple.podnapisi.net") { DownloadFileCompleted.Fire(this, null, null, null); return; } // pass the rest of the work to HTTPDownloader _dl = new HTTPDownloader(); _dl.DownloadProgressChanged += (s, e) => DownloadProgressChanged.Fire(this, e.Data); _dl.DownloadFileCompleted += (s, e) => DownloadFileCompleted.Fire(this, e.First, e.Second, e.Third); _dl.Download(dllink, target, token); }
/// <summary> /// Downloads the specified subtitle from subscene. /// </summary> /// <param name="url">The URL of the subtitle page.</param> /// <param name="target">The target location.</param> /// <param name="token">The user token.</param> private void InternalDownload(string url, string target, string token) { // get the info page var info = Utils.GetJSON("http://aliensubtitles.com/?d=" + Regex.Match(url, "/download#([0-9a-z]+)").Groups[1].Value + "&a=3a2677106d44d238f13ba200dd9ff53454af87a6"); DownloadProgressChanged.Fire(this, 25); // check download link if (info["url"] == null) { DownloadFileCompleted.Fire(this, null, null, null); return; } // pass the rest of the work to HTTPDownloader _dl = new HTTPDownloader(); _dl.DownloadProgressChanged += (s, e) => DownloadProgressChanged.Fire(this, e.Data); _dl.DownloadFileCompleted += (s, e) => DownloadFileCompleted.Fire(this, e.First, e.Second, e.Third); _dl.Download((string)info["url"], target, token); }
/// <summary> /// Downloads the specified subtitle from subscene. /// </summary> /// <param name="url">The URL of the subtitle page.</param> /// <param name="target">The target location.</param> /// <param name="token">The user token.</param> private void InternalDownload(string url, string target, string token) { // get the info page var info = Utils.GetURL(url); DownloadProgressChanged.Fire(this, 25); // extract required info var dllink = "http://subscene.com" + Regex.Match(info, "href=\"([^\"]+)\".*?id=\"downloadButton\"", RegexOptions.IgnoreCase).Groups[1].Value; // pass the rest of the work to HTTPDownloader _dl = new HTTPDownloader(); _dl.DownloadProgressChanged += (s, e) => DownloadProgressChanged.Fire(this, e.Data); _dl.DownloadFileCompleted += (s, e) => DownloadFileCompleted.Fire(this, e.First, e.Second, e.Third); _dl.Download(dllink, target, token); }