/// <summary> /// Creates a temporary container and sends it to the default associated application to DLC. /// </summary> /// <param name="link">The link.</param> private void SendToLinkContainerDownloader(Link link) { var tmp = Path.Combine(Path.GetTempPath(), Utils.CreateSlug(link.Release.Replace('.', ' ').Replace('_', ' ') + " " + link.Source.Name + " " + Utils.Rand.Next().ToString("x"), false) + ".dlc"); File.WriteAllText(tmp, DLCAPI.CreateDLC(link.Release, link.FileURL.Split('\0'))); Utils.Run(tmp); }
/// <summary> /// Rewrites a list of HTTP links to a local DLC container path. /// </summary> /// <param name="link">The link.</param> /// <returns>New copy of the link pointing to a DLC container.</returns> private Link RewriteHTTPLinksToDLC(Link link) { var tmp = Path.Combine(Path.GetTempPath(), Utils.CreateSlug(link.Release.Replace('.', ' ').Replace('_', ' ') + " " + link.Source.Name + " " + Utils.Rand.Next().ToString("x"), false) + ".dlc"); File.WriteAllText(tmp, DLCAPI.CreateDLC(link.Release, link.FileURL.Split('\0'))); return(new Link(link.Source) { Release = link.Release, InfoURL = link.InfoURL, FileURL = tmp, Infos = link.Infos, Quality = link.Quality, Size = link.Size }); }