forked from markus/S_New4
add check for term length at Load..-Msg
This commit is contained in:
parent
42bf257b6d
commit
f1abf83745
23
build-S_New4-Desktop-Debug/.qmake.stash
Normal file
23
build-S_New4-Desktop-Debug/.qmake.stash
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
|
||||||
|
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 9
|
||||||
|
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 3
|
||||||
|
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
|
||||||
|
QMAKE_CXX.COMPILER_MACROS = \
|
||||||
|
QT_COMPILER_STDCXX \
|
||||||
|
QMAKE_GCC_MAJOR_VERSION \
|
||||||
|
QMAKE_GCC_MINOR_VERSION \
|
||||||
|
QMAKE_GCC_PATCH_VERSION
|
||||||
|
QMAKE_CXX.INCDIRS = \
|
||||||
|
/usr/include/c++/9 \
|
||||||
|
/usr/include/x86_64-linux-gnu/c++/9 \
|
||||||
|
/usr/include/c++/9/backward \
|
||||||
|
/usr/lib/gcc/x86_64-linux-gnu/9/include \
|
||||||
|
/usr/local/include \
|
||||||
|
/usr/include/x86_64-linux-gnu \
|
||||||
|
/usr/include
|
||||||
|
QMAKE_CXX.LIBDIRS = \
|
||||||
|
/usr/lib/gcc/x86_64-linux-gnu/9 \
|
||||||
|
/usr/lib/x86_64-linux-gnu \
|
||||||
|
/usr/lib \
|
||||||
|
/lib/x86_64-linux-gnu \
|
||||||
|
/lib
|
23
build-S_New4-Desktop-Release/.qmake.stash
Normal file
23
build-S_New4-Desktop-Release/.qmake.stash
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
|
||||||
|
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 9
|
||||||
|
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 3
|
||||||
|
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
|
||||||
|
QMAKE_CXX.COMPILER_MACROS = \
|
||||||
|
QT_COMPILER_STDCXX \
|
||||||
|
QMAKE_GCC_MAJOR_VERSION \
|
||||||
|
QMAKE_GCC_MINOR_VERSION \
|
||||||
|
QMAKE_GCC_PATCH_VERSION
|
||||||
|
QMAKE_CXX.INCDIRS = \
|
||||||
|
/usr/include/c++/9 \
|
||||||
|
/usr/include/x86_64-linux-gnu/c++/9 \
|
||||||
|
/usr/include/c++/9/backward \
|
||||||
|
/usr/lib/gcc/x86_64-linux-gnu/9/include \
|
||||||
|
/usr/local/include \
|
||||||
|
/usr/include/x86_64-linux-gnu \
|
||||||
|
/usr/include
|
||||||
|
QMAKE_CXX.LIBDIRS = \
|
||||||
|
/usr/lib/gcc/x86_64-linux-gnu/9 \
|
||||||
|
/usr/lib/x86_64-linux-gnu \
|
||||||
|
/usr/lib \
|
||||||
|
/lib/x86_64-linux-gnu \
|
||||||
|
/lib
|
@ -49,6 +49,28 @@ static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
|
|||||||
return written;
|
return written;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#define VC_EXTRALEAN
|
||||||
|
#include <Windows.h>
|
||||||
|
#elif defined(__linux__)
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#endif // Windows/Linux
|
||||||
|
|
||||||
|
void PageManager::get_terminal_size(int& width) {
|
||||||
|
#if defined(_WIN32)
|
||||||
|
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||||
|
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
|
||||||
|
width = (int)(csbi.dwSize.X);
|
||||||
|
#elif defined(__linux__)
|
||||||
|
struct winsize w;
|
||||||
|
ioctl(fileno(stdout), TIOCGWINSZ, &w);
|
||||||
|
width = (int)(w.ws_col);
|
||||||
|
#endif // Windows/Linux
|
||||||
|
}
|
||||||
|
|
||||||
Reply PageManager::getServerRequest(std::string Url, bool useCookies, std::string data, bool generateCookieFile, bool UrlAfterRedirectOnlyNeeded)
|
Reply PageManager::getServerRequest(std::string Url, bool useCookies, std::string data, bool generateCookieFile, bool UrlAfterRedirectOnlyNeeded)
|
||||||
{
|
{
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
@ -57,8 +79,11 @@ Reply PageManager::getServerRequest(std::string Url, bool useCookies, std::strin
|
|||||||
char *url;
|
char *url;
|
||||||
std::string returnUrl;
|
std::string returnUrl;
|
||||||
|
|
||||||
|
|
||||||
|
int width;
|
||||||
|
get_terminal_size(width);
|
||||||
//info ausgabe
|
//info ausgabe
|
||||||
std::cout << ( "\33[2K\rLade: '" + Url + "'..." + ((debugMode) ? "\n" : "" )) << std::flush;
|
std::cout << ( "\33[2K\rLade: '" + std::string(Url).erase( (((width - 12) < (int)Url.length()) ? (width - 12) : Url.length() ) ) + "'..." + ((debugMode) ? "\n" : "" )) << std::flush;
|
||||||
|
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(!curl) {
|
if(!curl) {
|
||||||
|
@ -30,6 +30,8 @@ public:
|
|||||||
void setCookieFilePath(std::string path);
|
void setCookieFilePath(std::string path);
|
||||||
void setDebugMode(bool status);
|
void setDebugMode(bool status);
|
||||||
|
|
||||||
|
void get_terminal_size(int& width);
|
||||||
|
|
||||||
Reply getServerRequest(std::string Url, bool useCookies = false, std::string data = "", bool generateCookieFile = false, bool UrlAfterRedirectOnlyNeeded = false);
|
Reply getServerRequest(std::string Url, bool useCookies = false, std::string data = "", bool generateCookieFile = false, bool UrlAfterRedirectOnlyNeeded = false);
|
||||||
int downLoadToFile(std::string filePath, std::string url);
|
int downLoadToFile(std::string filePath, std::string url);
|
||||||
|
|
||||||
|
@ -1505,7 +1505,7 @@ int unterOption_printLogFile(Settings *settings, int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!printMode && !ClearMode) {
|
if(!printMode && !ClearMode) {
|
||||||
std::cout << " => Error: Fehlende Parameter: -p oder -c." << std::endl;
|
std::cout << " => Error: Fehlende Parameter: -p, --print oder -C, --colorless." << std::endl;
|
||||||
std::cout << "\"" << settings->programName << " log --help\" liefert weitere Informationen." << std::endl;
|
std::cout << "\"" << settings->programName << " log --help\" liefert weitere Informationen." << std::endl;
|
||||||
return 34;
|
return 34;
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ struct Settings {
|
|||||||
proxy_ip = "127.0.0.1",
|
proxy_ip = "127.0.0.1",
|
||||||
languages = "GerDub,GerSub,Eng,",
|
languages = "GerDub,GerSub,Eng,",
|
||||||
genaueHoster = "",
|
genaueHoster = "",
|
||||||
version = "4.2.0",
|
version = "4.2.1",
|
||||||
defaultFileVersion="1.8",
|
defaultFileVersion="1.8",
|
||||||
default_checkPath = "",
|
default_checkPath = "",
|
||||||
default_Searchmuster = "S%Staffel%E%Folge%";
|
default_Searchmuster = "S%Staffel%E%Folge%";
|
||||||
|
@ -470,6 +470,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest failed when download season page." << std::endl;
|
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest failed when download season page." << std::endl;
|
||||||
return 40;
|
return 40;
|
||||||
}
|
}
|
||||||
|
|
||||||
int maxFolge = pageManager.counterContains(tmp_reply.html, "/episode-%i");
|
int maxFolge = pageManager.counterContains(tmp_reply.html, "/episode-%i");
|
||||||
|
|
||||||
//Print seasons
|
//Print seasons
|
||||||
|
Loading…
Reference in New Issue
Block a user