S_New4/pageManager.h

56 lines
1.8 KiB
C
Raw Normal View History

2019-07-06 18:47:29 +00:00
#ifndef MANAGEPAGE_H
#define MANAGEPAGE_H
#include <iostream>
2019-07-08 18:17:11 +00:00
// if complied for windows; everything is in */projectfolder/curl/
2019-07-06 18:47:29 +00:00
#include <curl/curl.h>
#include <string.h>
#include <sstream>
2019-07-08 18:17:11 +00:00
#include <unistd.h>
2019-07-06 18:47:29 +00:00
#include <algorithm>
2019-07-06 18:47:29 +00:00
#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);
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