public override void getMovieSources(string urlMovie, ref Sources sources) { string buffer = string.Empty; string keyMovie = string.Empty; List <string> lSources = new List <string>(); string urlDecoded = string.Empty; string error = string.Empty; if (0 == error.Length) { HttpManager.requestGet(urlMovie, null, ref buffer, ref error); } if (0 == error.Length) { PelispediaHelper.getKeyMovie(urlMovie, buffer, ref keyMovie, ref error); } if (0 == error.Length) { PelispediaHelper.getUrlOptions(urlMovie, keyMovie, ref buffer, ref error); } if (0 == error.Length) { PelispediaHelper.getSources(buffer, ref lSources, ref error); } if (0 == error.Length) { foreach (string source in lSources) { if (source.StartsWith("https://load.pelispedia.vip/embed")) { error = string.Empty; if (decodeSource(source, ref urlDecoded, ref error)) { ServerScrapper.scrap(urlDecoded, ref sources, ref error); } if (error.Length > 0) { runOnLog(name(), "ERROR (" + urlMovie + ")", error); } } } } else { runOnLog(name(), "ERROR (" + urlMovie + ")", error); } }
bool decodeSource(string urlCodedSource, ref string urlDecodedSource, ref string error) { string codigo = string.Empty; string buffer = string.Empty; string urlAux = string.Empty; HttpHeaders responseHeaders = new HttpHeaders(); if (0 == error.Length) { HttpManager.requestGet(urlCodedSource, null, ref buffer, ref error); } if (0 == error.Length) { PelispediaHelper.getCode(buffer, ref codigo, ref error); } if (0 == error.Length) { PelispediaHelper.decryptUrl(urlCodedSource, codigo, ref urlAux, ref error); } if (0 == error.Length) { HttpManager.requestGetSR(urlAux, null, ref buffer, ref responseHeaders, ref error); } if (0 == error.Length) { if (!responseHeaders.exist("Location")) { error = "Location header missing"; } } if (0 == error.Length) { urlDecodedSource = responseHeaders.value("Location"); } if (error.Length > 0) { error = "decodeSource -> " + error; } return(0 == error.Length); }