S_New4/pageManager.h

54 lines
1.7 KiB
C
Raw Permalink Normal View History

2019-07-06 18:47:29 +00:00
#ifndef MANAGEPAGE_H
#define MANAGEPAGE_H
#include "accountManager.h"
2019-08-19 15:32:52 +00:00
#include "curl/curl.h"
2019-07-06 18:47:29 +00:00
#include <string.h>
#include <sstream>
2019-07-08 18:17:11 +00:00
#include <unistd.h>
#include <algorithm>
2019-07-06 18:47:29 +00:00
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);
2019-07-08 18:17:11 +00:00
void setCookieFilePath(std::string path);
void setDebugMode(bool status);
2019-07-07 16:30:37 +00:00
2019-07-06 18:47:29 +00:00
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);
2019-07-07 16:30:37 +00:00
int writeToFile(std::string path, std::string text);
2019-07-06 18:47:29 +00:00
const std::string UrlPraefix = "https://s.to/serie/stream/";
std::string sock5Proxy;
2019-07-06 18:47:29 +00:00
private:
std::string cookieFilePath;
2019-07-08 18:17:11 +00:00
bool debugMode = false;
2019-07-06 18:47:29 +00:00
};
#endif // MANAGEPAGE_H