S_New4/pageManager.h
2019-08-13 18:59:01 +02:00

56 lines
1.8 KiB
C++

#ifndef MANAGEPAGE_H
#define MANAGEPAGE_H
#include <iostream>
// if complied for windows; everything is in */projectfolder/curl/
#include <curl/curl.h>
#include <string.h>
#include <sstream>
#include <unistd.h>
#include <algorithm>
#include "accountManager.h"
struct Reply {
Reply() {}
Reply(std::string value_both) : html(value_both), url(value_both) {}
Reply(std::string html, std::string url) : html(html), url(url) {}
std::string html, url;
};
class PageManager
{
public:
PageManager(std::string sock5Proxy = "socks5://127.0.0.1:9150", std::string cookieFilePath = "/tmp/S_New4_cookies");
~PageManager();
void setProxy(std::string ip, int port);
void setCookieFilePath(std::string path);
void setDebugMode(bool status);
Reply getServerRequest(std::string Url, bool useCookies = false, std::string data = "", bool generateCookieFile = false);
int login(Account account);
std::string getUrlAfterRedirect(std::string Url);
std::string checkName(std::string Name);
std::string getLinks(std::string HTML);
std::string chooseHosterLink(std::string HosterList, std::string Hoster_with_Highst_Priority_at_First, std::string languages_with_highst_priority_at_first);
std::string replace(std::string str, std::string substr1, std::string substr2);
int counterContains(std::string text, std::string substring_with_prozent_i_for_number, int starte_mit_dieser_Zahl = 1);
std::string grep(std::string text, std::string substring, bool IgnoreCaseSensetifity = false);
std::string upper_string(const std::string& str);
int writeToFile(std::string path, std::string text);
const std::string UrlPraefix = "https://s.to/serie/stream/";
std::string sock5Proxy;
private:
std::string cookieFilePath;
bool debugMode = false;
};
#endif // MANAGEPAGE_H