forked from markus/S_New4
windows
This commit is contained in:
parent
afa1d76ea5
commit
a33e54d522
68
.gitignore
vendored
68
.gitignore
vendored
@ -1,34 +1,34 @@
|
||||
# This file is used to ignore files which are generated
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
*~
|
||||
*.autosave
|
||||
|
||||
*.moc
|
||||
*.o
|
||||
*.obj
|
||||
*.orig
|
||||
*.rej
|
||||
|
||||
|
||||
*.debug
|
||||
Makefile?*
|
||||
*.prl
|
||||
*.app
|
||||
moc_*.cpp
|
||||
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
|
||||
# qtcreator generated files
|
||||
*.pro.user*
|
||||
|
||||
# MinGW generated files
|
||||
*.Debug
|
||||
*.Release
|
||||
|
||||
|
||||
#Own adds:
|
||||
build*
|
||||
Makefile
|
||||
S_New4
|
||||
# This file is used to ignore files which are generated
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
*~
|
||||
*.autosave
|
||||
|
||||
*.moc
|
||||
*.o
|
||||
*.obj
|
||||
*.orig
|
||||
*.rej
|
||||
|
||||
|
||||
*.debug
|
||||
Makefile?*
|
||||
*.prl
|
||||
*.app
|
||||
moc_*.cpp
|
||||
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
|
||||
# qtcreator generated files
|
||||
*.pro.user*
|
||||
|
||||
# MinGW generated files
|
||||
*.Debug
|
||||
*.Release
|
||||
|
||||
|
||||
#Own adds:
|
||||
build*
|
||||
Makefile
|
||||
S_New4
|
||||
|
298
Changelog.md
298
Changelog.md
@ -1,149 +1,149 @@
|
||||
## Changelog
|
||||
|
||||
### v.5.1.1
|
||||
* Update Curl Lib & WinLib handling
|
||||
|
||||
### v.5.1.0
|
||||
* Add update Warning
|
||||
|
||||
### v.5.0.0
|
||||
* Multi Page support!
|
||||
|
||||
### v.4.3.0
|
||||
* Second Download url, if first doesn't work anymore
|
||||
|
||||
### v.4.2.0
|
||||
* New Update Url.... manuel update needed
|
||||
|
||||
### v.4.1.0
|
||||
* Change s.to -> serienstream.sx
|
||||
|
||||
### v.4.0.4
|
||||
* Fix Error: Konnte Position von script async= nicht finden
|
||||
|
||||
### v.4.0.2/3
|
||||
* Entferne /embed bei Vivo und ignoriere Groß-& Kleinschreib. Bei -l & -g
|
||||
|
||||
### v.4.0.1
|
||||
* Behebe falsche Position von der 0 bei der Zeit im LogFile
|
||||
|
||||
### v.4.0.0
|
||||
* Füge Architekture ARM v6 hinzu
|
||||
|
||||
### v.3.9.1/2/3
|
||||
* Behebe Fehler bei der Replace Funktion + Farben bei der LogFile ausgabe
|
||||
|
||||
### v.3.9.0
|
||||
* Neu: Möglichkeit, mehrere Dateien mit -o anzugeben
|
||||
* Im DefaultFile: Schreibe nun, wenn nicht verändert mit -o Ausgabe ins LogFile
|
||||
|
||||
### v.3.8.0
|
||||
* Log System
|
||||
|
||||
### v.3.6.3 -> 3.8
|
||||
* SIEHE IN GIT COMMITS
|
||||
|
||||
### v3.6.2
|
||||
* Füge ChangeLog Datei hinzu
|
||||
|
||||
### v3.6.1
|
||||
* Extra ausgabe bei ungültigen Redirect Links, vorallem bei Unterfunktion url
|
||||
* Verschiebe Source Dateien in den Order src/
|
||||
|
||||
### v3.6.0
|
||||
* Deaktivireung des Proxy mit Port 0 nun möglich
|
||||
|
||||
### v3.5.6
|
||||
* Bei Haupt Helpmenüe kann man nun -- weglassen bei --help
|
||||
|
||||
### v3.5.5
|
||||
* Stoppe nun sofort, wenn checkName Function durch fehlerhaften HTML code fehlschlägt
|
||||
|
||||
### v3.5.4
|
||||
* Größere Fehlerbehebungen
|
||||
|
||||
### v3.5.3
|
||||
* Bei Serienauswahl wird nun auch der 2.te Name falls vorhanden angezeigt ( bei 1ner Möglichkeiten (1 Serien gefunden) )
|
||||
|
||||
### v3.5.2
|
||||
* Bei Serienauswahl wird nun auch der 2.te Name falls vorhanden angezeigt ( bei mehren Möglichkeiten (verschiedenen Serien) )
|
||||
|
||||
### v3.5.1
|
||||
* Serienliste: Seriensortierung: Genres -> Alphabet
|
||||
|
||||
### v3.5.0
|
||||
* Neuer Parameter: -s bei der Unterfunktion info um Namenausgabe der einzelnen Folgen zu verhindern
|
||||
|
||||
### v3.4.6
|
||||
* Behebe Fehler bei Serien mit HTML Sonderzeichen im Namen in der Serienliste
|
||||
|
||||
### v3.4.5
|
||||
* Füge Farbausgabe bei der Unterfuktion info hinzu
|
||||
|
||||
### v3.4.4
|
||||
* Erseze HTML Sonderzeichen mit Asci Zeichen in info Unterfunktion
|
||||
* Verbessere Ausgabe bei der Unterfunktion info
|
||||
|
||||
### v3.4.3
|
||||
* Behbe bei manchen Function: In Windows Pfadzeichen / -> \
|
||||
* Behebe Fehler in Suchfunktion bei Serien mit einem / im Namen
|
||||
|
||||
### v3.4.2
|
||||
* Füge Fehlernachricht bei --remove hinzu, wenn kein Ordner ausgewählt wurde
|
||||
|
||||
### v3.4.1
|
||||
* Größere Fehlerbehebungen
|
||||
* Füge Unterfunktion --remove dem Helpmenü hinzu
|
||||
|
||||
### v3.4.0
|
||||
* Neue Unterfunktion: --remove
|
||||
|
||||
### v3.3.2
|
||||
* Entferne vor kurzem hinzugefügtes überprüfen nach HTML Fehlern beim herunterladen der Internetseiten
|
||||
|
||||
### v3.3.1
|
||||
* Verbesserung der Überprüfung der Versionen beim Updaten
|
||||
|
||||
### v3.3.0
|
||||
* Überarbeitung der Unterfunkion --update
|
||||
|
||||
### v3.2.0
|
||||
* Füge Update hinzu: Vorsicht fehlerhaft -> v3.2.0
|
||||
* Füge Function zum Downloaden in Dateien
|
||||
* Update Readme
|
||||
|
||||
### v3.1.1
|
||||
* Behebe Pfade im Helpmenü
|
||||
* Update Readme
|
||||
* füge Windows Libraries hinzu
|
||||
|
||||
### v3.1.0
|
||||
* Mann kan nun bei Ungültiger Serie 1ne Serie aus mehreren Möglichkeiten auswählen, falls vorhanden
|
||||
|
||||
### v3.0.6 / v3.0.5
|
||||
* Behebe Überschreibung des Namens in der Serienauswahlfunktion
|
||||
* Debug Nachrichten & Besseres Aussehen der Debug nachrichten
|
||||
* Behebe Fehler: Programm stoppt wenn Staffel beendet ist, wartet aber nicht auf die Threads
|
||||
|
||||
### v3.0.4
|
||||
* Behebe Fehler beim 1. mal Updaten der Serienliste, wenn die Datei noch nicht existiert
|
||||
|
||||
### v3.0.3
|
||||
* Behebe Helpmenü fehler
|
||||
* Füge Hoster * hinzu, aber nur mit Trick möglich, da dieser Vorgang unnötig viele Accounts braucht
|
||||
|
||||
### v3.0.2
|
||||
* Aktualisiere Unterfuktion search's Helpmenü
|
||||
* Aktualisiere Defaults-Datei (neue Bezeichnungen)
|
||||
|
||||
### v3.0.1
|
||||
* Größere Fehlerbehebungen
|
||||
* Nun möglich: Updaten der serienliste und Namesuche
|
||||
|
||||
### v3.0.0
|
||||
* Füge Updatewarnsystem bei Serienliste hinzu
|
||||
|
||||
### Vorher
|
||||
* -
|
||||
|
||||
|
||||
## Changelog
|
||||
|
||||
### v.5.1.1
|
||||
* Update Curl Lib & WinLib handling
|
||||
|
||||
### v.5.1.0
|
||||
* Add update Warning
|
||||
|
||||
### v.5.0.0
|
||||
* Multi Page support!
|
||||
|
||||
### v.4.3.0
|
||||
* Second Download url, if first doesn't work anymore
|
||||
|
||||
### v.4.2.0
|
||||
* New Update Url.... manuel update needed
|
||||
|
||||
### v.4.1.0
|
||||
* Change s.to -> serienstream.sx
|
||||
|
||||
### v.4.0.4
|
||||
* Fix Error: Konnte Position von script async= nicht finden
|
||||
|
||||
### v.4.0.2/3
|
||||
* Entferne /embed bei Vivo und ignoriere Groß-& Kleinschreib. Bei -l & -g
|
||||
|
||||
### v.4.0.1
|
||||
* Behebe falsche Position von der 0 bei der Zeit im LogFile
|
||||
|
||||
### v.4.0.0
|
||||
* Füge Architekture ARM v6 hinzu
|
||||
|
||||
### v.3.9.1/2/3
|
||||
* Behebe Fehler bei der Replace Funktion + Farben bei der LogFile ausgabe
|
||||
|
||||
### v.3.9.0
|
||||
* Neu: Möglichkeit, mehrere Dateien mit -o anzugeben
|
||||
* Im DefaultFile: Schreibe nun, wenn nicht verändert mit -o Ausgabe ins LogFile
|
||||
|
||||
### v.3.8.0
|
||||
* Log System
|
||||
|
||||
### v.3.6.3 -> 3.8
|
||||
* SIEHE IN GIT COMMITS
|
||||
|
||||
### v3.6.2
|
||||
* Füge ChangeLog Datei hinzu
|
||||
|
||||
### v3.6.1
|
||||
* Extra ausgabe bei ungültigen Redirect Links, vorallem bei Unterfunktion url
|
||||
* Verschiebe Source Dateien in den Order src/
|
||||
|
||||
### v3.6.0
|
||||
* Deaktivireung des Proxy mit Port 0 nun möglich
|
||||
|
||||
### v3.5.6
|
||||
* Bei Haupt Helpmenüe kann man nun -- weglassen bei --help
|
||||
|
||||
### v3.5.5
|
||||
* Stoppe nun sofort, wenn checkName Function durch fehlerhaften HTML code fehlschlägt
|
||||
|
||||
### v3.5.4
|
||||
* Größere Fehlerbehebungen
|
||||
|
||||
### v3.5.3
|
||||
* Bei Serienauswahl wird nun auch der 2.te Name falls vorhanden angezeigt ( bei 1ner Möglichkeiten (1 Serien gefunden) )
|
||||
|
||||
### v3.5.2
|
||||
* Bei Serienauswahl wird nun auch der 2.te Name falls vorhanden angezeigt ( bei mehren Möglichkeiten (verschiedenen Serien) )
|
||||
|
||||
### v3.5.1
|
||||
* Serienliste: Seriensortierung: Genres -> Alphabet
|
||||
|
||||
### v3.5.0
|
||||
* Neuer Parameter: -s bei der Unterfunktion info um Namenausgabe der einzelnen Folgen zu verhindern
|
||||
|
||||
### v3.4.6
|
||||
* Behebe Fehler bei Serien mit HTML Sonderzeichen im Namen in der Serienliste
|
||||
|
||||
### v3.4.5
|
||||
* Füge Farbausgabe bei der Unterfuktion info hinzu
|
||||
|
||||
### v3.4.4
|
||||
* Erseze HTML Sonderzeichen mit Asci Zeichen in info Unterfunktion
|
||||
* Verbessere Ausgabe bei der Unterfunktion info
|
||||
|
||||
### v3.4.3
|
||||
* Behbe bei manchen Function: In Windows Pfadzeichen / -> \
|
||||
* Behebe Fehler in Suchfunktion bei Serien mit einem / im Namen
|
||||
|
||||
### v3.4.2
|
||||
* Füge Fehlernachricht bei --remove hinzu, wenn kein Ordner ausgewählt wurde
|
||||
|
||||
### v3.4.1
|
||||
* Größere Fehlerbehebungen
|
||||
* Füge Unterfunktion --remove dem Helpmenü hinzu
|
||||
|
||||
### v3.4.0
|
||||
* Neue Unterfunktion: --remove
|
||||
|
||||
### v3.3.2
|
||||
* Entferne vor kurzem hinzugefügtes überprüfen nach HTML Fehlern beim herunterladen der Internetseiten
|
||||
|
||||
### v3.3.1
|
||||
* Verbesserung der Überprüfung der Versionen beim Updaten
|
||||
|
||||
### v3.3.0
|
||||
* Überarbeitung der Unterfunkion --update
|
||||
|
||||
### v3.2.0
|
||||
* Füge Update hinzu: Vorsicht fehlerhaft -> v3.2.0
|
||||
* Füge Function zum Downloaden in Dateien
|
||||
* Update Readme
|
||||
|
||||
### v3.1.1
|
||||
* Behebe Pfade im Helpmenü
|
||||
* Update Readme
|
||||
* füge Windows Libraries hinzu
|
||||
|
||||
### v3.1.0
|
||||
* Mann kan nun bei Ungültiger Serie 1ne Serie aus mehreren Möglichkeiten auswählen, falls vorhanden
|
||||
|
||||
### v3.0.6 / v3.0.5
|
||||
* Behebe Überschreibung des Namens in der Serienauswahlfunktion
|
||||
* Debug Nachrichten & Besseres Aussehen der Debug nachrichten
|
||||
* Behebe Fehler: Programm stoppt wenn Staffel beendet ist, wartet aber nicht auf die Threads
|
||||
|
||||
### v3.0.4
|
||||
* Behebe Fehler beim 1. mal Updaten der Serienliste, wenn die Datei noch nicht existiert
|
||||
|
||||
### v3.0.3
|
||||
* Behebe Helpmenü fehler
|
||||
* Füge Hoster * hinzu, aber nur mit Trick möglich, da dieser Vorgang unnötig viele Accounts braucht
|
||||
|
||||
### v3.0.2
|
||||
* Aktualisiere Unterfuktion search's Helpmenü
|
||||
* Aktualisiere Defaults-Datei (neue Bezeichnungen)
|
||||
|
||||
### v3.0.1
|
||||
* Größere Fehlerbehebungen
|
||||
* Nun möglich: Updaten der serienliste und Namesuche
|
||||
|
||||
### v3.0.0
|
||||
* Füge Updatewarnsystem bei Serienliste hinzu
|
||||
|
||||
### Vorher
|
||||
* -
|
||||
|
||||
|
||||
|
160
README.md
160
README.md
@ -1,80 +1,80 @@
|
||||
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
|
||||
|
||||
|
||||
# S_New4
|
||||
|
||||
Aufruf: S_New4 [Unteroption] [PARAMETER]...
|
||||
|
||||
### Beschreibung:
|
||||
-> Mit diesem Programm kann man die Download-Urls
|
||||
oder Informationen von Serien bekommen.
|
||||
-> Mit diesem Programm kann man Redirect-Links von
|
||||
s.to umwandeln.
|
||||
|
||||
### Unteroptionen:
|
||||
"--help" Gibt dieses Helpmenue aus.
|
||||
"--version" Gibt die Version des Programmes aus.
|
||||
"--update" Modus um das Programm zu aktualisieren.
|
||||
Updater funktioniert nur bei: Windows/Linux -
|
||||
x86 Architekutur - 64 Bit Systemen und Arm6 32 Bit.
|
||||
"--remove" Modus um Ordner mit Einstellungen/
|
||||
Zwischengespeicherte-Dateien zu löschen.
|
||||
"url" Modus um eigene Redirect-Links umzuwandeln.
|
||||
"default" Modus um Links von Serien zu bekommen.
|
||||
"search" Modus um Serien zu suchen.
|
||||
"info" Modus um Infos einer Serien zu bekommen.
|
||||
"clean" Modus um Cookie-Files zu löschen.
|
||||
"news" Modus um neusten 75 Folgen auf s.to zu sehen.
|
||||
"log" Modus um Log Datei zu sehen / leeren.
|
||||
|
||||
### Verzeichnisse:
|
||||
Ordner zum zwischenspeichern der Cookies und der AccountNummer:
|
||||
> '/home/*/.cache/S_New4/' - Linux
|
||||
> '%LocalAppData%/S_New4' - Windows
|
||||
Ordner zum speichern der Accounts und Default-Einstellungen:
|
||||
> '/home/*/.config/S_New4/' - Linux
|
||||
> '%AppData%/S_New4' - Windows
|
||||
|
||||
|
||||
## Updater Funktion:
|
||||
##### S_New4 hat einen Updater der für folgende Systeme funktioniert:
|
||||
##### * Windows, 64 Bit Programm ( Die neue Version ist immer 64 Bit ), x86 Architektur
|
||||
##### * Linux, 64 Bit Programm ( Die neue Version ist immer 64 Bit ), x86 Architektur
|
||||
##### * Linux, 32 Bit Programm ( Die neue Version ist immer 32 Bit ), ARM v6
|
||||
|
||||
|
||||
|
||||
|
||||
# Compalieren
|
||||
|
||||
|
||||
### Linux:
|
||||
|
||||
##### Abhängigkeiten:
|
||||
|
||||
```sh
|
||||
sudo apt install libcurl4-openssl-dev
|
||||
```
|
||||
|
||||
#### g++
|
||||
```sh
|
||||
g++ --std=c++14 accountManager.cpp accountManager.h main.cpp pageManager.cpp pageManager.h parameterManager.cpp parameterManager.h programManager.cpp programManager.h logger.h logger.cpp -lcurl -lpthread -o S_New4
|
||||
```
|
||||
|
||||
#### QT-Style:
|
||||
```sh
|
||||
qmake && make
|
||||
```
|
||||
|
||||
### Windows: (nur x86_64 Architekture, wenn beigefügte Libraries verwendet werden möchten)
|
||||
|
||||
##### Abhängigkeiten:
|
||||
|
||||
Empfohlen: Verwende S_New4 mit einem Unicode Compatiblem Terminal: Zum Beispiel mit dem
|
||||
Git Bash Terminal
|
||||
|
||||
#### QT-Style: ( MinGW-64Bit )
|
||||
|
||||
Nutze den QT-Creator:
|
||||
> In dem Unterordner curl/ befinden sich die benötigten Header- und Curl-Lib-Dateien für curl
|
||||
> C++ und Winpthread Libs befinden sich in dem Ordner x86_64-WIN_LIBS/
|
||||
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
|
||||
|
||||
|
||||
# S_New4
|
||||
|
||||
Aufruf: S_New4 [Unteroption] [PARAMETER]...
|
||||
|
||||
### Beschreibung:
|
||||
-> Mit diesem Programm kann man die Download-Urls
|
||||
oder Informationen von Serien bekommen.
|
||||
-> Mit diesem Programm kann man Redirect-Links von
|
||||
s.to umwandeln.
|
||||
|
||||
### Unteroptionen:
|
||||
"--help" Gibt dieses Helpmenue aus.
|
||||
"--version" Gibt die Version des Programmes aus.
|
||||
"--update" Modus um das Programm zu aktualisieren.
|
||||
Updater funktioniert nur bei: Windows/Linux -
|
||||
x86 Architekutur - 64 Bit Systemen und Arm6 32 Bit.
|
||||
"--remove" Modus um Ordner mit Einstellungen/
|
||||
Zwischengespeicherte-Dateien zu löschen.
|
||||
"url" Modus um eigene Redirect-Links umzuwandeln.
|
||||
"default" Modus um Links von Serien zu bekommen.
|
||||
"search" Modus um Serien zu suchen.
|
||||
"info" Modus um Infos einer Serien zu bekommen.
|
||||
"clean" Modus um Cookie-Files zu löschen.
|
||||
"news" Modus um neusten 75 Folgen auf s.to zu sehen.
|
||||
"log" Modus um Log Datei zu sehen / leeren.
|
||||
|
||||
### Verzeichnisse:
|
||||
Ordner zum zwischenspeichern der Cookies und der AccountNummer:
|
||||
> '/home/*/.cache/S_New4/' - Linux
|
||||
> '%LocalAppData%/S_New4' - Windows
|
||||
Ordner zum speichern der Accounts und Default-Einstellungen:
|
||||
> '/home/*/.config/S_New4/' - Linux
|
||||
> '%AppData%/S_New4' - Windows
|
||||
|
||||
|
||||
## Updater Funktion:
|
||||
##### S_New4 hat einen Updater der für folgende Systeme funktioniert:
|
||||
##### * Windows, 64 Bit Programm ( Die neue Version ist immer 64 Bit ), x86 Architektur
|
||||
##### * Linux, 64 Bit Programm ( Die neue Version ist immer 64 Bit ), x86 Architektur
|
||||
##### * Linux, 32 Bit Programm ( Die neue Version ist immer 32 Bit ), ARM v6
|
||||
|
||||
|
||||
|
||||
|
||||
# Compalieren
|
||||
|
||||
|
||||
### Linux:
|
||||
|
||||
##### Abhängigkeiten:
|
||||
|
||||
```sh
|
||||
sudo apt install libcurl4-openssl-dev
|
||||
```
|
||||
|
||||
#### g++
|
||||
```sh
|
||||
g++ --std=c++14 accountManager.cpp accountManager.h main.cpp pageManager.cpp pageManager.h parameterManager.cpp parameterManager.h programManager.cpp programManager.h logger.h logger.cpp -lcurl -lpthread -o S_New4
|
||||
```
|
||||
|
||||
#### QT-Style:
|
||||
```sh
|
||||
qmake && make
|
||||
```
|
||||
|
||||
### Windows: (nur x86_64 Architekture, wenn beigefügte Libraries verwendet werden möchten)
|
||||
|
||||
##### Abhängigkeiten:
|
||||
|
||||
Empfohlen: Verwende S_New4 mit einem Unicode Compatiblem Terminal: Zum Beispiel mit dem
|
||||
Git Bash Terminal
|
||||
|
||||
#### QT-Style: ( MinGW-64Bit )
|
||||
|
||||
Nutze den QT-Creator:
|
||||
> In dem Unterordner curl/ befinden sich die benötigten Header- und Curl-Lib-Dateien für curl
|
||||
> C++ und Winpthread Libs befinden sich in dem Ordner x86_64-WIN_LIBS/
|
||||
|
152
alt/g++/.gitignore
vendored
152
alt/g++/.gitignore
vendored
@ -1,76 +1,76 @@
|
||||
# This file is used to ignore files which are generated
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
*~
|
||||
*.autosave
|
||||
*.a
|
||||
*.core
|
||||
*.moc
|
||||
*.o
|
||||
*.obj
|
||||
*.orig
|
||||
*.rej
|
||||
*.so
|
||||
*.so.*
|
||||
*_pch.h.cpp
|
||||
*_resource.rc
|
||||
*.qm
|
||||
.#*
|
||||
*.*#
|
||||
core
|
||||
!core/
|
||||
tags
|
||||
.DS_Store
|
||||
.directory
|
||||
*.debug
|
||||
Makefile*
|
||||
*.prl
|
||||
*.app
|
||||
moc_*.cpp
|
||||
ui_*.h
|
||||
qrc_*.cpp
|
||||
Thumbs.db
|
||||
*.res
|
||||
*.rc
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
|
||||
# qtcreator generated files
|
||||
*.pro.user*
|
||||
|
||||
# xemacs temporary files
|
||||
*.flc
|
||||
|
||||
# Vim temporary files
|
||||
.*.swp
|
||||
|
||||
# Visual Studio generated files
|
||||
*.ib_pdb_index
|
||||
*.idb
|
||||
*.ilk
|
||||
*.pdb
|
||||
*.sln
|
||||
*.suo
|
||||
*.vcproj
|
||||
*vcproj.*.*.user
|
||||
*.ncb
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.vcxproj
|
||||
*vcxproj.*
|
||||
|
||||
# MinGW generated files
|
||||
*.Debug
|
||||
*.Release
|
||||
|
||||
# Python byte code
|
||||
*.pyc
|
||||
|
||||
# Binaries
|
||||
# --------
|
||||
*.dll
|
||||
*.exe
|
||||
|
||||
#Own adds:
|
||||
g++/*
|
||||
|
||||
# This file is used to ignore files which are generated
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
*~
|
||||
*.autosave
|
||||
*.a
|
||||
*.core
|
||||
*.moc
|
||||
*.o
|
||||
*.obj
|
||||
*.orig
|
||||
*.rej
|
||||
*.so
|
||||
*.so.*
|
||||
*_pch.h.cpp
|
||||
*_resource.rc
|
||||
*.qm
|
||||
.#*
|
||||
*.*#
|
||||
core
|
||||
!core/
|
||||
tags
|
||||
.DS_Store
|
||||
.directory
|
||||
*.debug
|
||||
Makefile*
|
||||
*.prl
|
||||
*.app
|
||||
moc_*.cpp
|
||||
ui_*.h
|
||||
qrc_*.cpp
|
||||
Thumbs.db
|
||||
*.res
|
||||
*.rc
|
||||
/.qmake.cache
|
||||
/.qmake.stash
|
||||
|
||||
# qtcreator generated files
|
||||
*.pro.user*
|
||||
|
||||
# xemacs temporary files
|
||||
*.flc
|
||||
|
||||
# Vim temporary files
|
||||
.*.swp
|
||||
|
||||
# Visual Studio generated files
|
||||
*.ib_pdb_index
|
||||
*.idb
|
||||
*.ilk
|
||||
*.pdb
|
||||
*.sln
|
||||
*.suo
|
||||
*.vcproj
|
||||
*vcproj.*.*.user
|
||||
*.ncb
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.vcxproj
|
||||
*vcxproj.*
|
||||
|
||||
# MinGW generated files
|
||||
*.Debug
|
||||
*.Release
|
||||
|
||||
# Python byte code
|
||||
*.pyc
|
||||
|
||||
# Binaries
|
||||
# --------
|
||||
*.dll
|
||||
*.exe
|
||||
|
||||
#Own adds:
|
||||
g++/*
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
i686-w64-mingw32-g++ ./*.h ./*.cpp -o S_New4_x32.exe -DCURL_STATICLIB -static-libgcc -static-libstdc++ -lpthread -lcurl -lwldap32 -lws2_32 -std=c++11
|
||||
sleep 3
|
||||
#!/bin/bash
|
||||
|
||||
i686-w64-mingw32-g++ ./*.h ./*.cpp -o S_New4_x32.exe -DCURL_STATICLIB -static-libgcc -static-libstdc++ -lpthread -lcurl -lwldap32 -lws2_32 -std=c++11
|
||||
sleep 3
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
#x86_64-w64-mingw32-g++ ./*.h ./*.cpp -o S_New4_x64.exe -DCURL_STATICLIB -static-libgcc -static-libstdc++ -lpthread -lcurl -lwldap32 -lws2_32 -std=c++11
|
||||
x86_64-w64-mingw32-g++ ./*.h ./*.cpp -o S_New4_x64.exe -static-libgcc -static-libstdc++ -lpthread -lcurl -lws2_32 -std=c++11
|
||||
sleep 3
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
#x86_64-w64-mingw32-g++ ./*.h ./*.cpp -o S_New4_x64.exe -DCURL_STATICLIB -static-libgcc -static-libstdc++ -lpthread -lcurl -lwldap32 -lws2_32 -std=c++11
|
||||
x86_64-w64-mingw32-g++ ./*.h ./*.cpp -o S_New4_x64.exe -static-libgcc -static-libstdc++ -lpthread -lcurl -lws2_32 -std=c++11
|
||||
sleep 3
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
|
||||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 5
|
||||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 5
|
||||
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 = \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include/c++ \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include/c++/x86_64-w64-mingw32.static \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include/c++/backward \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include-fixed \
|
||||
/home/markus/git/mxe/usr/x86_64-w64-mingw32.static/include
|
||||
QMAKE_CXX.LIBDIRS = \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0 \
|
||||
/home/markus/git/mxe/usr/x86_64-w64-mingw32.static/lib
|
||||
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
|
||||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 5
|
||||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 5
|
||||
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 = \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include/c++ \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include/c++/x86_64-w64-mingw32.static \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include/c++/backward \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0/include-fixed \
|
||||
/home/markus/git/mxe/usr/x86_64-w64-mingw32.static/include
|
||||
QMAKE_CXX.LIBDIRS = \
|
||||
/home/markus/git/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/5.5.0 \
|
||||
/home/markus/git/mxe/usr/x86_64-w64-mingw32.static/lib
|
||||
|
@ -1,44 +1,44 @@
|
||||
QT -= gui
|
||||
#CONFIG += -static -libstdc++ -static-libgcc #-static
|
||||
|
||||
#Linux:
|
||||
unix: LIBS += -lcurl
|
||||
|
||||
#Windows
|
||||
win32: LIBS += -L$${_PRO_FILE_PWD_}\..\lib\ -lcurl # 7.82.0
|
||||
#win32: LIBS += -L$${_PRO_FILE_PWD_}\..\alt\ -lcurl # 7.64.1
|
||||
|
||||
|
||||
CONFIG += c++17 console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
pageManager.cpp \
|
||||
parameterManager.cpp \
|
||||
programManager.cpp \
|
||||
accountManager.cpp \
|
||||
logger.cpp
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
HEADERS += \
|
||||
pageManager.h \
|
||||
parameterManager.h \
|
||||
programManager.h \
|
||||
accountManager.h \
|
||||
logger.h
|
||||
QT -= gui
|
||||
#CONFIG += -static -libstdc++ -static-libgcc #-static
|
||||
|
||||
#Linux:
|
||||
unix: LIBS += -lcurl
|
||||
|
||||
#Windows
|
||||
win32: LIBS += -L$${_PRO_FILE_PWD_}\..\lib\ -lcurl # 7.82.0
|
||||
#win32: LIBS += -L$${_PRO_FILE_PWD_}\..\alt\ -lcurl # 7.64.1
|
||||
|
||||
|
||||
CONFIG += c++17 console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
pageManager.cpp \
|
||||
parameterManager.cpp \
|
||||
programManager.cpp \
|
||||
accountManager.cpp \
|
||||
logger.cpp
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
HEADERS += \
|
||||
pageManager.h \
|
||||
parameterManager.h \
|
||||
programManager.h \
|
||||
accountManager.h \
|
||||
logger.h
|
||||
|
@ -1,275 +1,275 @@
|
||||
#include "accountManager.h"
|
||||
|
||||
AccountManager::AccountManager(std::string pathToFil, std::string pathToAccountNumberFile, PAGE page, const PAGE *pagesALL)
|
||||
: pagesALL(pagesALL), pathToAccountNumberFile(pathToAccountNumberFile + "_" + page.name_id), pageInUse(page)
|
||||
{
|
||||
std::string pathToAccountsFile = pathToFil + "_" + page.name_id;
|
||||
std::ifstream ifs(pathToAccountsFile);
|
||||
if(!ifs.is_open()) {
|
||||
if(writeDefault(pathToAccountsFile) != 0)
|
||||
exit(12);
|
||||
ifs.open(pathToAccountsFile);
|
||||
if(!ifs.is_open()) {
|
||||
std::cout << " => Error: Konnte Account File nicht aufmachen" << std::endl;
|
||||
exit(13);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::string line;
|
||||
while (std::getline(ifs, line)) {
|
||||
if(line.length() > 0 && line[0] == '#')
|
||||
continue;
|
||||
Account account;
|
||||
size_t Delimeter = line.find("/");
|
||||
|
||||
if(Delimeter == std::string::npos) {
|
||||
account.Email = line;
|
||||
account.Password = line;
|
||||
} else {
|
||||
account.Email = std::string(line).erase(Delimeter, line.length() - Delimeter);
|
||||
account.Password = line.erase(0, Delimeter + 1);
|
||||
}
|
||||
if(account.Email == "" || account.Password == "")
|
||||
continue;
|
||||
else
|
||||
accounts.push_back(account);
|
||||
}
|
||||
|
||||
ifs.close();
|
||||
|
||||
}
|
||||
|
||||
Account AccountManager::getNextAccount()
|
||||
{
|
||||
if(accounts.size() == 0) {
|
||||
std::cout << " => Error: Keine Accounts vorhanden." << std::endl;
|
||||
exit(36);
|
||||
}
|
||||
size_t accountNumber = getLastAccountNumber();
|
||||
++accountNumber;
|
||||
|
||||
if( accountNumber >= accounts.size() )
|
||||
accountNumber=0;
|
||||
if(setLastAccountNumber(accountNumber) != 0)
|
||||
exit(45);
|
||||
|
||||
return accounts.at(accountNumber);
|
||||
}
|
||||
|
||||
int AccountManager::writeDefault(std::string path)
|
||||
{
|
||||
std::ofstream ofs(path);
|
||||
if(!ofs.is_open()) {
|
||||
perror((std::string(" => Error: Konnte Account Datei nicht aufmachen: ") + path).c_str());
|
||||
return -1;
|
||||
}
|
||||
std::cout << " => Erstelle Datei mit Accounts unter: " << path << "..." <<std::endl;
|
||||
ofs << "# <- Am Anfang der Zeile deaktiviert diese." << std::endl;
|
||||
ofs << "#Email/Passwort - Falls diese gleich sind, geht auch nur Email oder Passwort" << std::endl;
|
||||
|
||||
enum pagesID {
|
||||
STO,
|
||||
ANICLOUD,
|
||||
STOIP,
|
||||
SERIENCAM,
|
||||
SERIENSTREAMTO
|
||||
};
|
||||
|
||||
if( pageInUse.url == pagesALL[STO].url
|
||||
|| pageInUse.url == pagesALL[STOIP].url
|
||||
|| pageInUse.url == pagesALL[SERIENCAM].url
|
||||
|| pageInUse.url == pagesALL[SERIENSTREAMTO].url)
|
||||
{
|
||||
ofs << "EntzueckendPackenderSkorpion@oida.icu" << std::endl;
|
||||
ofs << "HumorvollWundervollerDelfin@spam.care/HumorvollWundervollerDelfin@spam.care" << std::endl;
|
||||
ofs << "ExzellentPackenderHirsch@muell.icu/ExzellentPackenderHirsch@muell.icu" << std::endl;
|
||||
ofs << "GrandiosLeuchtenderPanda@papierkorb.me" << std::endl;
|
||||
ofs << "AttraktivPositiverSteinbock@magspam.net" << std::endl;
|
||||
ofs << "FreundlichKostbarerSteinbock@spam.care" << std::endl;
|
||||
ofs << "FabelhaftSelbstsichererUhu@spam.care" << std::endl;
|
||||
ofs << "HumorvollSinnlicherRabe@muell.icu" << std::endl;
|
||||
ofs << "AnspruchsvollTraumhafterPavian@ultra.fyi" << std::endl;
|
||||
ofs << "FaszinierendRiskanterLuchs@magspam.net" << std::endl;
|
||||
ofs << "BeruehmtMystischerPanda@ultra.fyi" << std::endl;
|
||||
ofs << "CharmantRasanterLoewe@existiert.net" << std::endl;
|
||||
ofs << "BedeutendLuesternerAal@existiert.net" << std::endl;
|
||||
ofs << "ElegantSelbstsichererAdler@ultra.fyi" << std::endl;
|
||||
ofs << "FaszinierendKoeniglicherBaer@spam.care" << std::endl;
|
||||
ofs << "CharmantKostbarerLoewe@magspam.net" << std::endl;
|
||||
ofs << "BedeutendPrallerSkorpion@muellemail.com" << std::endl;
|
||||
ofs << "FreundlichPerfekterRochen@muellmail.com" << std::endl;
|
||||
ofs << "AusgelassenKostbarerBasilisk@magspam.net" << std::endl;
|
||||
ofs << "FabelhaftLebhafterSchakal@ultra.fyi" << std::endl;
|
||||
ofs << "ExzellentSchoenerSteinbock@existiert.net" << std::endl;
|
||||
ofs << "ErhellendLustvollerAdler@muell.icu" << std::endl;
|
||||
ofs << "ExzellentIdealerSchakal@muell.icu" << std::endl;
|
||||
ofs << "BrillantVitalerSalamander@spam.care" << std::endl;
|
||||
ofs << "BezauberndRiesigerSchakal@oida.icu" << std::endl;
|
||||
ofs << "DynamischWarmerBaer@magspam.net" << std::endl;
|
||||
ofs << "EmotionalLeidenschaftlicherBaer@oida.icu" << std::endl;
|
||||
ofs << "BewundernswertWarmerSchwan@oida.icu" << std::endl;
|
||||
ofs << "HuebschUnfassbarerAal@papierkorb.me" << std::endl;
|
||||
ofs << "FroehlichWundervollerBiber@muellmail.com" << std::endl;
|
||||
ofs << "BefreiendWilderDelfin@spam.care" << std::endl;
|
||||
ofs << "FreundlichStilvollerTiger@oida.icu" << std::endl;
|
||||
ofs << "EchtKoeniglicherStorch@existiert.net" << std::endl;
|
||||
ofs << "BefluegeltPrallerSchwan@spam.care" << std::endl;
|
||||
ofs << "ErhellendSeltenerSeeloewe@ultra.fyi" << std::endl;
|
||||
ofs << "FreundlichZuverlaessigerSchwan@spam.care" << std::endl;
|
||||
ofs << "HervorragendWundervollerReiher@oida.icu" << std::endl;
|
||||
ofs << "AnspruchsvollStilvollerUhu@magspam.net" << std::endl;
|
||||
ofs << "AnmutigTraumhafterHai@muellemail.com" << std::endl;
|
||||
ofs << "AtemberaubendIdealerTapir@ultra.fyi" << std::endl;
|
||||
ofs << "GeheimLeuchtenderLuchs@muellemail.com" << std::endl;
|
||||
ofs << "DuftendKlarerTapir@muellmail.com" << std::endl;
|
||||
ofs << "GeheimUnwiderstehlicherRabe@muell.icu" << std::endl;
|
||||
ofs << "ExtravagantSpektakulaererAdler@spam.care" << std::endl;
|
||||
ofs << "BildlichWarmerLoewe@oida.icu" << std::endl;
|
||||
ofs << "AktivKlarerHai@spam.care" << std::endl;
|
||||
ofs << "AktivKostbarerElch@oida.icu" << std::endl;
|
||||
ofs << "Strust1991@jourrapide.com" << std::endl;
|
||||
ofs << "Natchoughe1928@dayrep.com" << std::endl;
|
||||
ofs << "zweirot@einrot.com" << std::endl;
|
||||
ofs << "AktivMagischerFrosch@existiert.net" << std::endl;
|
||||
ofs << "ErhellendPerfekterDachs@existiert.net" << std::endl;
|
||||
ofs << "ojfvwj.fgf@existiert.net" << std::endl;
|
||||
ofs << "lusiouae@wegwerfemail.de" << std::endl;
|
||||
ofs << "fraiwrou@wegwerfemail.de" << std::endl;
|
||||
ofs << "driotean@wegwerfemail.de" << std::endl;
|
||||
ofs << "tiaprour@wegwerfemail.de" << std::endl;
|
||||
ofs << "FeurigWarmerPapagei@existiert.net" << std::endl;
|
||||
ofs << "FrischStilvollerPavian@magspam.net" << std::endl;
|
||||
ofs << "FeurigZaghafterLoewe@muellmail.com" << std::endl;
|
||||
ofs << "GigantischKoeniglicherSchwan@magspam.net" << std::endl;
|
||||
ofs << "FreizuegigPersoenlicherLemming@spam.care" << std::endl;
|
||||
ofs << "BelebtIntelligenterHusky@papierkorb.me" << std::endl;
|
||||
ofs << "FreundlichMaximalerSpecht@muellmail.com" << std::endl;
|
||||
ofs << "FreundlichStarkerHirsch@ultra.fyi" << std::endl;
|
||||
ofs << "ErstklassigRasanterElch@oida.icu" << std::endl;
|
||||
ofs << "FreundlichStarkerPavian@ultra.fyi" << std::endl;
|
||||
ofs << "EinfuehlsamRiskanterPapagei@oida.icu" << std::endl;
|
||||
ofs << "FantastischPositiverHirsch@existiert.net" << std::endl;
|
||||
ofs << "GeborgenIndividuellerOtter@muell.icu" << std::endl;
|
||||
ofs << "HervorragendSensibelerWal@oida.icu" << std::endl;
|
||||
ofs << "HerrlichIndividuellerPelikan@spam.care" << std::endl;
|
||||
ofs << "HerrlichLeuchtenderTapir@muellmail.com" << std::endl;
|
||||
ofs << "ErstaunlichIntensiverEsel@magspam.net" << std::endl;
|
||||
ofs << "ExtravagantPraechtigerWal@muellemail.com" << std::endl;
|
||||
ofs << "GravierendWundervollerFalke@spam.care" << std::endl;
|
||||
ofs << "EntzueckendLebhafterFlamingo@magspam.net" << std::endl;
|
||||
ofs << "GeheimSprachloserStorch@existiert.net" << std::endl;
|
||||
ofs << "GravierendVitalerOtter@spam.care" << std::endl;
|
||||
ofs << "GrenzenlosInteressanterElch@oida.icu" << std::endl;
|
||||
ofs << "HellPackenderGoldfisch@muellemail.com" << std::endl;
|
||||
ofs << "AbenteuerlichSelbstloserFalke@muell.icu" << std::endl;
|
||||
ofs << "EmotionalZaghafterPapagei@magspam.net" << std::endl;
|
||||
ofs << "HellLiebenswerterElefant@muellemail.com" << std::endl;
|
||||
ofs << "BildlichImponierenderEsel@muellemail.com" << std::endl;
|
||||
ofs << "ErstaunlichSprachloserPapagei@ultra.fyi" << std::endl;
|
||||
ofs << "BerauschendLebendigerDelfin@ultra.fyi" << std::endl;
|
||||
ofs << "GravierendIntensiverHase@oida.icu" << std::endl;
|
||||
ofs << "BerauschendUnglaublicherGorilla@oida.icu" << std::endl;
|
||||
ofs << "GenuesslichPraechtigerDachs@spam.care" << std::endl;
|
||||
|
||||
} else if( pageInUse.url == pagesALL[ANICLOUD].url ) {
|
||||
ofs << "C322334ark1954@teleworm.us/C322334ark1954@teleworm.us" << std::endl;
|
||||
ofs << "wemixex225@iconmle.com/wemixex225@iconmle.com" << std::endl;
|
||||
ofs << "Thw86757utary@teleworm.us" << std::endl;
|
||||
ofs << "thw811ssssutary@teleworm.us" << std::endl;
|
||||
ofs << "Leonardoutary@teleworm.us" << std::endl;
|
||||
ofs << "efgewtzhewtrhterw@tonne.to" << std::endl;
|
||||
ofs << "dwfwqefqefqe@dsgvo.ru" << std::endl;
|
||||
ofs << "dfdfgwgwrgwg@muell.ru" << std::endl;
|
||||
ofs << "BildlichSprachloserWal@spam.care" << std::endl;
|
||||
ofs << "BildlichLustvollerRochen@muell.ru" << std::endl;
|
||||
ofs << "AngenehmMaximalerHai@muell.icu" << std::endl;
|
||||
ofs << "FreundlichKostbarerWolf@fukaru.com" << std::endl;
|
||||
ofs << "animewatcherxgas120@oida.icu" << std::endl;
|
||||
ofs << "animewatcherxgas7776@oida.icu" << std::endl;
|
||||
ofs << "animewatcherxgas777116@oida.icu" << std::endl;
|
||||
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
} else {
|
||||
std::cout << " => WARNUNG: Keine standart Accounts für die Url '" << pageInUse.url << "' vorhanden." <<std::endl;
|
||||
}
|
||||
|
||||
ofs.close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t AccountManager::getLastAccountNumber()
|
||||
{
|
||||
std::ifstream fStream;
|
||||
fStream.open(pathToAccountNumberFile);
|
||||
if(!fStream.is_open()) {
|
||||
std::ofstream ofs;
|
||||
ofs.open(pathToAccountNumberFile);
|
||||
ofs << "0" << std::endl;
|
||||
ofs.close();
|
||||
fStream.open(pathToAccountNumberFile);
|
||||
if(!fStream.is_open()) {
|
||||
perror(" => Error: Konnte Account Number Datei nicht erstellen");
|
||||
exit(34);
|
||||
}
|
||||
}
|
||||
|
||||
std::string content( (std::istreambuf_iterator<char>(fStream) ), (std::istreambuf_iterator<char>() ) );
|
||||
return static_cast<size_t>( atoi(content.c_str()) );
|
||||
}
|
||||
|
||||
int AccountManager::setLastAccountNumber(size_t number)
|
||||
{
|
||||
std::ofstream ofs;
|
||||
ofs.open(pathToAccountNumberFile, std::ios::trunc);
|
||||
if(!ofs.is_open()) {
|
||||
std::cout << " => Error: Account Number Datei ist nicht aufgemacht." << std::endl;
|
||||
return 110;
|
||||
}
|
||||
//fStream.clear();
|
||||
ofs << number << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "accountManager.h"
|
||||
|
||||
AccountManager::AccountManager(std::string pathToFil, std::string pathToAccountNumberFile, PAGE page, const PAGE *pagesALL)
|
||||
: pagesALL(pagesALL), pathToAccountNumberFile(pathToAccountNumberFile + "_" + page.name_id), pageInUse(page)
|
||||
{
|
||||
std::string pathToAccountsFile = pathToFil + "_" + page.name_id;
|
||||
std::ifstream ifs(pathToAccountsFile);
|
||||
if(!ifs.is_open()) {
|
||||
if(writeDefault(pathToAccountsFile) != 0)
|
||||
exit(12);
|
||||
ifs.open(pathToAccountsFile);
|
||||
if(!ifs.is_open()) {
|
||||
std::cout << " => Error: Konnte Account File nicht aufmachen" << std::endl;
|
||||
exit(13);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::string line;
|
||||
while (std::getline(ifs, line)) {
|
||||
if(line.length() > 0 && line[0] == '#')
|
||||
continue;
|
||||
Account account;
|
||||
size_t Delimeter = line.find("/");
|
||||
|
||||
if(Delimeter == std::string::npos) {
|
||||
account.Email = line;
|
||||
account.Password = line;
|
||||
} else {
|
||||
account.Email = std::string(line).erase(Delimeter, line.length() - Delimeter);
|
||||
account.Password = line.erase(0, Delimeter + 1);
|
||||
}
|
||||
if(account.Email == "" || account.Password == "")
|
||||
continue;
|
||||
else
|
||||
accounts.push_back(account);
|
||||
}
|
||||
|
||||
ifs.close();
|
||||
|
||||
}
|
||||
|
||||
Account AccountManager::getNextAccount()
|
||||
{
|
||||
if(accounts.size() == 0) {
|
||||
std::cout << " => Error: Keine Accounts vorhanden." << std::endl;
|
||||
exit(36);
|
||||
}
|
||||
size_t accountNumber = getLastAccountNumber();
|
||||
++accountNumber;
|
||||
|
||||
if( accountNumber >= accounts.size() )
|
||||
accountNumber=0;
|
||||
if(setLastAccountNumber(accountNumber) != 0)
|
||||
exit(45);
|
||||
|
||||
return accounts.at(accountNumber);
|
||||
}
|
||||
|
||||
int AccountManager::writeDefault(std::string path)
|
||||
{
|
||||
std::ofstream ofs(path);
|
||||
if(!ofs.is_open()) {
|
||||
perror((std::string(" => Error: Konnte Account Datei nicht aufmachen: ") + path).c_str());
|
||||
return -1;
|
||||
}
|
||||
std::cout << " => Erstelle Datei mit Accounts unter: " << path << "..." <<std::endl;
|
||||
ofs << "# <- Am Anfang der Zeile deaktiviert diese." << std::endl;
|
||||
ofs << "#Email/Passwort - Falls diese gleich sind, geht auch nur Email oder Passwort" << std::endl;
|
||||
|
||||
enum pagesID {
|
||||
STO,
|
||||
ANICLOUD,
|
||||
STOIP,
|
||||
SERIENCAM,
|
||||
SERIENSTREAMTO
|
||||
};
|
||||
|
||||
if( pageInUse.url == pagesALL[STO].url
|
||||
|| pageInUse.url == pagesALL[STOIP].url
|
||||
|| pageInUse.url == pagesALL[SERIENCAM].url
|
||||
|| pageInUse.url == pagesALL[SERIENSTREAMTO].url)
|
||||
{
|
||||
ofs << "EntzueckendPackenderSkorpion@oida.icu" << std::endl;
|
||||
ofs << "HumorvollWundervollerDelfin@spam.care/HumorvollWundervollerDelfin@spam.care" << std::endl;
|
||||
ofs << "ExzellentPackenderHirsch@muell.icu/ExzellentPackenderHirsch@muell.icu" << std::endl;
|
||||
ofs << "GrandiosLeuchtenderPanda@papierkorb.me" << std::endl;
|
||||
ofs << "AttraktivPositiverSteinbock@magspam.net" << std::endl;
|
||||
ofs << "FreundlichKostbarerSteinbock@spam.care" << std::endl;
|
||||
ofs << "FabelhaftSelbstsichererUhu@spam.care" << std::endl;
|
||||
ofs << "HumorvollSinnlicherRabe@muell.icu" << std::endl;
|
||||
ofs << "AnspruchsvollTraumhafterPavian@ultra.fyi" << std::endl;
|
||||
ofs << "FaszinierendRiskanterLuchs@magspam.net" << std::endl;
|
||||
ofs << "BeruehmtMystischerPanda@ultra.fyi" << std::endl;
|
||||
ofs << "CharmantRasanterLoewe@existiert.net" << std::endl;
|
||||
ofs << "BedeutendLuesternerAal@existiert.net" << std::endl;
|
||||
ofs << "ElegantSelbstsichererAdler@ultra.fyi" << std::endl;
|
||||
ofs << "FaszinierendKoeniglicherBaer@spam.care" << std::endl;
|
||||
ofs << "CharmantKostbarerLoewe@magspam.net" << std::endl;
|
||||
ofs << "BedeutendPrallerSkorpion@muellemail.com" << std::endl;
|
||||
ofs << "FreundlichPerfekterRochen@muellmail.com" << std::endl;
|
||||
ofs << "AusgelassenKostbarerBasilisk@magspam.net" << std::endl;
|
||||
ofs << "FabelhaftLebhafterSchakal@ultra.fyi" << std::endl;
|
||||
ofs << "ExzellentSchoenerSteinbock@existiert.net" << std::endl;
|
||||
ofs << "ErhellendLustvollerAdler@muell.icu" << std::endl;
|
||||
ofs << "ExzellentIdealerSchakal@muell.icu" << std::endl;
|
||||
ofs << "BrillantVitalerSalamander@spam.care" << std::endl;
|
||||
ofs << "BezauberndRiesigerSchakal@oida.icu" << std::endl;
|
||||
ofs << "DynamischWarmerBaer@magspam.net" << std::endl;
|
||||
ofs << "EmotionalLeidenschaftlicherBaer@oida.icu" << std::endl;
|
||||
ofs << "BewundernswertWarmerSchwan@oida.icu" << std::endl;
|
||||
ofs << "HuebschUnfassbarerAal@papierkorb.me" << std::endl;
|
||||
ofs << "FroehlichWundervollerBiber@muellmail.com" << std::endl;
|
||||
ofs << "BefreiendWilderDelfin@spam.care" << std::endl;
|
||||
ofs << "FreundlichStilvollerTiger@oida.icu" << std::endl;
|
||||
ofs << "EchtKoeniglicherStorch@existiert.net" << std::endl;
|
||||
ofs << "BefluegeltPrallerSchwan@spam.care" << std::endl;
|
||||
ofs << "ErhellendSeltenerSeeloewe@ultra.fyi" << std::endl;
|
||||
ofs << "FreundlichZuverlaessigerSchwan@spam.care" << std::endl;
|
||||
ofs << "HervorragendWundervollerReiher@oida.icu" << std::endl;
|
||||
ofs << "AnspruchsvollStilvollerUhu@magspam.net" << std::endl;
|
||||
ofs << "AnmutigTraumhafterHai@muellemail.com" << std::endl;
|
||||
ofs << "AtemberaubendIdealerTapir@ultra.fyi" << std::endl;
|
||||
ofs << "GeheimLeuchtenderLuchs@muellemail.com" << std::endl;
|
||||
ofs << "DuftendKlarerTapir@muellmail.com" << std::endl;
|
||||
ofs << "GeheimUnwiderstehlicherRabe@muell.icu" << std::endl;
|
||||
ofs << "ExtravagantSpektakulaererAdler@spam.care" << std::endl;
|
||||
ofs << "BildlichWarmerLoewe@oida.icu" << std::endl;
|
||||
ofs << "AktivKlarerHai@spam.care" << std::endl;
|
||||
ofs << "AktivKostbarerElch@oida.icu" << std::endl;
|
||||
ofs << "Strust1991@jourrapide.com" << std::endl;
|
||||
ofs << "Natchoughe1928@dayrep.com" << std::endl;
|
||||
ofs << "zweirot@einrot.com" << std::endl;
|
||||
ofs << "AktivMagischerFrosch@existiert.net" << std::endl;
|
||||
ofs << "ErhellendPerfekterDachs@existiert.net" << std::endl;
|
||||
ofs << "ojfvwj.fgf@existiert.net" << std::endl;
|
||||
ofs << "lusiouae@wegwerfemail.de" << std::endl;
|
||||
ofs << "fraiwrou@wegwerfemail.de" << std::endl;
|
||||
ofs << "driotean@wegwerfemail.de" << std::endl;
|
||||
ofs << "tiaprour@wegwerfemail.de" << std::endl;
|
||||
ofs << "FeurigWarmerPapagei@existiert.net" << std::endl;
|
||||
ofs << "FrischStilvollerPavian@magspam.net" << std::endl;
|
||||
ofs << "FeurigZaghafterLoewe@muellmail.com" << std::endl;
|
||||
ofs << "GigantischKoeniglicherSchwan@magspam.net" << std::endl;
|
||||
ofs << "FreizuegigPersoenlicherLemming@spam.care" << std::endl;
|
||||
ofs << "BelebtIntelligenterHusky@papierkorb.me" << std::endl;
|
||||
ofs << "FreundlichMaximalerSpecht@muellmail.com" << std::endl;
|
||||
ofs << "FreundlichStarkerHirsch@ultra.fyi" << std::endl;
|
||||
ofs << "ErstklassigRasanterElch@oida.icu" << std::endl;
|
||||
ofs << "FreundlichStarkerPavian@ultra.fyi" << std::endl;
|
||||
ofs << "EinfuehlsamRiskanterPapagei@oida.icu" << std::endl;
|
||||
ofs << "FantastischPositiverHirsch@existiert.net" << std::endl;
|
||||
ofs << "GeborgenIndividuellerOtter@muell.icu" << std::endl;
|
||||
ofs << "HervorragendSensibelerWal@oida.icu" << std::endl;
|
||||
ofs << "HerrlichIndividuellerPelikan@spam.care" << std::endl;
|
||||
ofs << "HerrlichLeuchtenderTapir@muellmail.com" << std::endl;
|
||||
ofs << "ErstaunlichIntensiverEsel@magspam.net" << std::endl;
|
||||
ofs << "ExtravagantPraechtigerWal@muellemail.com" << std::endl;
|
||||
ofs << "GravierendWundervollerFalke@spam.care" << std::endl;
|
||||
ofs << "EntzueckendLebhafterFlamingo@magspam.net" << std::endl;
|
||||
ofs << "GeheimSprachloserStorch@existiert.net" << std::endl;
|
||||
ofs << "GravierendVitalerOtter@spam.care" << std::endl;
|
||||
ofs << "GrenzenlosInteressanterElch@oida.icu" << std::endl;
|
||||
ofs << "HellPackenderGoldfisch@muellemail.com" << std::endl;
|
||||
ofs << "AbenteuerlichSelbstloserFalke@muell.icu" << std::endl;
|
||||
ofs << "EmotionalZaghafterPapagei@magspam.net" << std::endl;
|
||||
ofs << "HellLiebenswerterElefant@muellemail.com" << std::endl;
|
||||
ofs << "BildlichImponierenderEsel@muellemail.com" << std::endl;
|
||||
ofs << "ErstaunlichSprachloserPapagei@ultra.fyi" << std::endl;
|
||||
ofs << "BerauschendLebendigerDelfin@ultra.fyi" << std::endl;
|
||||
ofs << "GravierendIntensiverHase@oida.icu" << std::endl;
|
||||
ofs << "BerauschendUnglaublicherGorilla@oida.icu" << std::endl;
|
||||
ofs << "GenuesslichPraechtigerDachs@spam.care" << std::endl;
|
||||
|
||||
} else if( pageInUse.url == pagesALL[ANICLOUD].url ) {
|
||||
ofs << "C322334ark1954@teleworm.us/C322334ark1954@teleworm.us" << std::endl;
|
||||
ofs << "wemixex225@iconmle.com/wemixex225@iconmle.com" << std::endl;
|
||||
ofs << "Thw86757utary@teleworm.us" << std::endl;
|
||||
ofs << "thw811ssssutary@teleworm.us" << std::endl;
|
||||
ofs << "Leonardoutary@teleworm.us" << std::endl;
|
||||
ofs << "efgewtzhewtrhterw@tonne.to" << std::endl;
|
||||
ofs << "dwfwqefqefqe@dsgvo.ru" << std::endl;
|
||||
ofs << "dfdfgwgwrgwg@muell.ru" << std::endl;
|
||||
ofs << "BildlichSprachloserWal@spam.care" << std::endl;
|
||||
ofs << "BildlichLustvollerRochen@muell.ru" << std::endl;
|
||||
ofs << "AngenehmMaximalerHai@muell.icu" << std::endl;
|
||||
ofs << "FreundlichKostbarerWolf@fukaru.com" << std::endl;
|
||||
ofs << "animewatcherxgas120@oida.icu" << std::endl;
|
||||
ofs << "animewatcherxgas7776@oida.icu" << std::endl;
|
||||
ofs << "animewatcherxgas777116@oida.icu" << std::endl;
|
||||
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
// ofs << "" << std::endl;
|
||||
} else {
|
||||
std::cout << " => WARNUNG: Keine standart Accounts für die Url '" << pageInUse.url << "' vorhanden." <<std::endl;
|
||||
}
|
||||
|
||||
ofs.close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t AccountManager::getLastAccountNumber()
|
||||
{
|
||||
std::ifstream fStream;
|
||||
fStream.open(pathToAccountNumberFile);
|
||||
if(!fStream.is_open()) {
|
||||
std::ofstream ofs;
|
||||
ofs.open(pathToAccountNumberFile);
|
||||
ofs << "0" << std::endl;
|
||||
ofs.close();
|
||||
fStream.open(pathToAccountNumberFile);
|
||||
if(!fStream.is_open()) {
|
||||
perror(" => Error: Konnte Account Number Datei nicht erstellen");
|
||||
exit(34);
|
||||
}
|
||||
}
|
||||
|
||||
std::string content( (std::istreambuf_iterator<char>(fStream) ), (std::istreambuf_iterator<char>() ) );
|
||||
return static_cast<size_t>( atoi(content.c_str()) );
|
||||
}
|
||||
|
||||
int AccountManager::setLastAccountNumber(size_t number)
|
||||
{
|
||||
std::ofstream ofs;
|
||||
ofs.open(pathToAccountNumberFile, std::ios::trunc);
|
||||
if(!ofs.is_open()) {
|
||||
std::cout << " => Error: Account Number Datei ist nicht aufgemacht." << std::endl;
|
||||
return 110;
|
||||
}
|
||||
//fStream.clear();
|
||||
ofs << number << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,36 +1,36 @@
|
||||
#ifndef ACCOUNTMANAGER_H
|
||||
#define ACCOUNTMANAGER_H
|
||||
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
struct Account {
|
||||
std::string Email,
|
||||
Password;
|
||||
};
|
||||
|
||||
|
||||
//wichtig vor Account declaration!!!!
|
||||
#include "parameterManager.h"
|
||||
|
||||
class AccountManager
|
||||
{
|
||||
public:
|
||||
AccountManager(std::string pathToFile, std::string pathToAccountNumberFile, PAGE page, const PAGE * pagesALL);
|
||||
Account getNextAccount();
|
||||
size_t getLastAccountNumber();
|
||||
const PAGE * pagesALL;
|
||||
|
||||
private:
|
||||
std::vector<Account> accounts;
|
||||
std::string pathToAccountNumberFile;
|
||||
PAGE pageInUse;
|
||||
int setLastAccountNumber(size_t number);
|
||||
int writeDefault(std::string path);
|
||||
|
||||
};
|
||||
|
||||
#endif // ACCOUNTMANAGER_H
|
||||
#ifndef ACCOUNTMANAGER_H
|
||||
#define ACCOUNTMANAGER_H
|
||||
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
struct Account {
|
||||
std::string Email,
|
||||
Password;
|
||||
};
|
||||
|
||||
|
||||
//wichtig vor Account declaration!!!!
|
||||
#include "parameterManager.h"
|
||||
|
||||
class AccountManager
|
||||
{
|
||||
public:
|
||||
AccountManager(std::string pathToFile, std::string pathToAccountNumberFile, PAGE page, const PAGE * pagesALL);
|
||||
Account getNextAccount();
|
||||
size_t getLastAccountNumber();
|
||||
const PAGE * pagesALL;
|
||||
|
||||
private:
|
||||
std::vector<Account> accounts;
|
||||
std::string pathToAccountNumberFile;
|
||||
PAGE pageInUse;
|
||||
int setLastAccountNumber(size_t number);
|
||||
int writeDefault(std::string path);
|
||||
|
||||
};
|
||||
|
||||
#endif // ACCOUNTMANAGER_H
|
||||
|
BIN
src/debug/S_New4.exe
Normal file
BIN
src/debug/S_New4.exe
Normal file
Binary file not shown.
170
src/logger.cpp
170
src/logger.cpp
@ -1,85 +1,85 @@
|
||||
#include "logger.h"
|
||||
|
||||
Logger::Logger(std::string logFilePathm)
|
||||
: filePath(logFilePathm)
|
||||
{
|
||||
if(openFile(filePath))
|
||||
exit(234);
|
||||
}
|
||||
|
||||
Logger::~Logger()
|
||||
{
|
||||
file.close();
|
||||
}
|
||||
|
||||
std::string Logger::getFilePath()
|
||||
{
|
||||
return filePath;
|
||||
}
|
||||
|
||||
int Logger::logCommandLine(std::string logText)
|
||||
{
|
||||
std::time_t now = std::time(nullptr);
|
||||
struct tm *tm_now = localtime(&now);
|
||||
std::string date((tm_now->tm_mday < 10 ? "0" : "") + std::to_string(tm_now->tm_mday) + "." +
|
||||
(tm_now->tm_mon +1 < 10 ? "0" : "" ) + std::to_string(tm_now->tm_mon +1) + "." +
|
||||
std::to_string(1900 + tm_now->tm_year) + " - " +
|
||||
(tm_now->tm_hour < 10 ? "0" : "" ) + std::to_string(tm_now->tm_hour) + ":" +
|
||||
(tm_now->tm_min < 10 ? "0" : "" ) + std::to_string(tm_now->tm_min));
|
||||
return writetoFile( " -> " + date + ": \"" + logText + "\"");
|
||||
}
|
||||
|
||||
int Logger::logSubLine(std::string line)
|
||||
{
|
||||
return writetoFile("\t\t" + line);
|
||||
}
|
||||
|
||||
std::string Logger::getLogText()
|
||||
{
|
||||
return std::string((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
|
||||
}
|
||||
|
||||
int Logger::clearFile()
|
||||
{
|
||||
//close it
|
||||
file.close();
|
||||
|
||||
//open it empty + close it
|
||||
std::ofstream ofs;
|
||||
ofs.open(filePath, std::ofstream::out | std::ofstream::trunc);
|
||||
if(!ofs.is_open()) {
|
||||
perror("Open File for clearing failed");
|
||||
return 35;
|
||||
}
|
||||
ofs.close();
|
||||
|
||||
//reopen it
|
||||
return openFile(filePath);
|
||||
}
|
||||
|
||||
int Logger::writetoFile(std::string t)
|
||||
{
|
||||
file << t << std::endl;
|
||||
return file.good();
|
||||
}
|
||||
|
||||
int Logger::openFile(std::string path)
|
||||
{
|
||||
file.open(path, std::ios::in | std::ios::out | std::ios::app);
|
||||
if(!file.is_open()) {
|
||||
//Exestiert nicht => Erstelle Datei
|
||||
std::ofstream ofs(path);
|
||||
if(!ofs.is_open()) {
|
||||
perror((" => Error: Konnte LogDatei nicht erstellen: '" + path + "'").c_str());
|
||||
return (5656);
|
||||
} else {
|
||||
ofs.close();
|
||||
}
|
||||
file.open(path);
|
||||
if(!file.is_open()) {
|
||||
perror((" => Error: Konnte LogDatei nicht aufmachen: '" + path + "'").c_str());
|
||||
return (5657);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#include "logger.h"
|
||||
|
||||
Logger::Logger(std::string logFilePathm)
|
||||
: filePath(logFilePathm)
|
||||
{
|
||||
if(openFile(filePath))
|
||||
exit(234);
|
||||
}
|
||||
|
||||
Logger::~Logger()
|
||||
{
|
||||
file.close();
|
||||
}
|
||||
|
||||
std::string Logger::getFilePath()
|
||||
{
|
||||
return filePath;
|
||||
}
|
||||
|
||||
int Logger::logCommandLine(std::string logText)
|
||||
{
|
||||
std::time_t now = std::time(nullptr);
|
||||
struct tm *tm_now = localtime(&now);
|
||||
std::string date((tm_now->tm_mday < 10 ? "0" : "") + std::to_string(tm_now->tm_mday) + "." +
|
||||
(tm_now->tm_mon +1 < 10 ? "0" : "" ) + std::to_string(tm_now->tm_mon +1) + "." +
|
||||
std::to_string(1900 + tm_now->tm_year) + " - " +
|
||||
(tm_now->tm_hour < 10 ? "0" : "" ) + std::to_string(tm_now->tm_hour) + ":" +
|
||||
(tm_now->tm_min < 10 ? "0" : "" ) + std::to_string(tm_now->tm_min));
|
||||
return writetoFile( " -> " + date + ": \"" + logText + "\"");
|
||||
}
|
||||
|
||||
int Logger::logSubLine(std::string line)
|
||||
{
|
||||
return writetoFile("\t\t" + line);
|
||||
}
|
||||
|
||||
std::string Logger::getLogText()
|
||||
{
|
||||
return std::string((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
|
||||
}
|
||||
|
||||
int Logger::clearFile()
|
||||
{
|
||||
//close it
|
||||
file.close();
|
||||
|
||||
//open it empty + close it
|
||||
std::ofstream ofs;
|
||||
ofs.open(filePath, std::ofstream::out | std::ofstream::trunc);
|
||||
if(!ofs.is_open()) {
|
||||
perror("Open File for clearing failed");
|
||||
return 35;
|
||||
}
|
||||
ofs.close();
|
||||
|
||||
//reopen it
|
||||
return openFile(filePath);
|
||||
}
|
||||
|
||||
int Logger::writetoFile(std::string t)
|
||||
{
|
||||
file << t << std::endl;
|
||||
return file.good();
|
||||
}
|
||||
|
||||
int Logger::openFile(std::string path)
|
||||
{
|
||||
file.open(path, std::ios::in | std::ios::out | std::ios::app);
|
||||
if(!file.is_open()) {
|
||||
//Exestiert nicht => Erstelle Datei
|
||||
std::ofstream ofs(path);
|
||||
if(!ofs.is_open()) {
|
||||
perror((" => Error: Konnte LogDatei nicht erstellen: '" + path + "'").c_str());
|
||||
return (5656);
|
||||
} else {
|
||||
ofs.close();
|
||||
}
|
||||
file.open(path);
|
||||
if(!file.is_open()) {
|
||||
perror((" => Error: Konnte LogDatei nicht aufmachen: '" + path + "'").c_str());
|
||||
return (5657);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
72
src/logger.h
72
src/logger.h
@ -1,36 +1,36 @@
|
||||
#ifndef LOGGER_H
|
||||
#define LOGGER_H
|
||||
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <streambuf>
|
||||
#include <ctime> // std::time, localtime ...
|
||||
|
||||
|
||||
#include "parameterManager.h"
|
||||
|
||||
|
||||
class Logger
|
||||
{
|
||||
public:
|
||||
Logger(std::string logFilePathm);
|
||||
~Logger();
|
||||
std::string getFilePath();
|
||||
std::fstream file;
|
||||
|
||||
int logCommandLine(std::string logText);
|
||||
int logSubLine(std::string line);
|
||||
std::string getLogText();
|
||||
int clearFile();
|
||||
|
||||
|
||||
private:
|
||||
std::string filePath;
|
||||
int writetoFile(std::string t);
|
||||
int openFile(std::string path);
|
||||
};
|
||||
|
||||
#endif // LOGGER_H
|
||||
#ifndef LOGGER_H
|
||||
#define LOGGER_H
|
||||
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <streambuf>
|
||||
#include <ctime> // std::time, localtime ...
|
||||
|
||||
|
||||
#include "parameterManager.h"
|
||||
|
||||
|
||||
class Logger
|
||||
{
|
||||
public:
|
||||
Logger(std::string logFilePathm);
|
||||
~Logger();
|
||||
std::string getFilePath();
|
||||
std::fstream file;
|
||||
|
||||
int logCommandLine(std::string logText);
|
||||
int logSubLine(std::string line);
|
||||
std::string getLogText();
|
||||
int clearFile();
|
||||
|
||||
|
||||
private:
|
||||
std::string filePath;
|
||||
int writetoFile(std::string t);
|
||||
int openFile(std::string path);
|
||||
};
|
||||
|
||||
#endif // LOGGER_H
|
||||
|
42
src/main.cpp
42
src/main.cpp
@ -1,21 +1,21 @@
|
||||
#include "programManager.h"
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
ProgramManager mainProgram;
|
||||
Settings settings;
|
||||
int res = manageParameter(settings, argc, argv);
|
||||
if(res == -1)
|
||||
return 0;
|
||||
else if(res != 0) {
|
||||
if(settings.debugMode)
|
||||
std::cout << " => Error: Das Auswerten der Parameter ist fehlgeschlagen!" << std::endl;
|
||||
return res;
|
||||
} else {
|
||||
if( (res = mainProgram.start(&settings)) != 0 )
|
||||
std::cout << (" => Entschuldigung, ein Fehler ist aufgetreten!\n Bei wiederholtem Auftreten verwenden Sie -d, --debug für mehr Infos\n"
|
||||
" oder --update um, falls vorhanden, auf eine neuere Version des Programms zu wechseln") << std::endl;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
#include "programManager.h"
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
ProgramManager mainProgram;
|
||||
Settings settings;
|
||||
int res = manageParameter(settings, argc, argv);
|
||||
if(res == -1)
|
||||
return 0;
|
||||
else if(res != 0) {
|
||||
if(settings.debugMode)
|
||||
std::cout << " => Error: Das Auswerten der Parameter ist fehlgeschlagen!" << std::endl;
|
||||
return res;
|
||||
} else {
|
||||
if( (res = mainProgram.start(&settings)) != 0 )
|
||||
std::cout << (" => Entschuldigung, ein Fehler ist aufgetreten!\n Bei wiederholtem Auftreten verwenden Sie -d, --debug für mehr Infos\n"
|
||||
" oder --update um, falls vorhanden, auf eine neuere Version des Programms zu wechseln") << std::endl;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
1451
src/pageManager.cpp
1451
src/pageManager.cpp
File diff suppressed because it is too large
Load Diff
@ -1,81 +1,83 @@
|
||||
#ifndef MANAGEPAGE_H
|
||||
#define MANAGEPAGE_H
|
||||
|
||||
|
||||
#include "accountManager.h"
|
||||
#include "parameterManager.h" // for isNumber
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "./../include/curl/curl.h"
|
||||
#include <windows.h>
|
||||
|
||||
//----------------------?????????????????
|
||||
#define noSLLCheck
|
||||
|
||||
#else
|
||||
#include "curl/curl.h"
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
#include <unistd.h> // sleep
|
||||
#include <algorithm>
|
||||
#include <ctime> // std::time, localtime ...
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
struct checkNameRply {
|
||||
std::string name;
|
||||
PAGE pageInUse;
|
||||
enum STATUS { SUCCESS, FAILED, NOTHING_FOUND, MULTIPLE_OPTIONS, NO_WORKING_PAGE } status;
|
||||
|
||||
checkNameRply(const std::string &name, const PAGE &p, const checkNameRply::STATUS &s )
|
||||
: name(name), pageInUse(p), status(s) {}
|
||||
};
|
||||
|
||||
|
||||
class PageManager
|
||||
{
|
||||
public:
|
||||
PageManager(std::string sock5ProxyOnlyAddress = "127.0.0.1:9150");
|
||||
~PageManager();
|
||||
|
||||
void setProxy(std::string ip, int port);
|
||||
void setDebugMode(bool status);
|
||||
|
||||
void get_terminal_size(int& width);
|
||||
|
||||
Reply getServerRequest(std::string protocol, std::string Url, bool useCookies = false, std::string data = "", bool generateCookieFile = false, bool UrlAfterRedirectOnlyNeeded = false, std::string cookieFilePath = "");
|
||||
int downLoadToFile(std::string filePath, std::string url);
|
||||
|
||||
int login(PAGE page, Account account, std::string cookieFilePath);
|
||||
Reply getUrlAfterRedirect(std::string p, std::string Url, std::string cookieFilePath);
|
||||
checkNameRply checkName(std::vector<PAGE> &pages, std::string Name, bool useFirstPage);
|
||||
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, bool withWarnMsg);
|
||||
std::string getLinkAfterHosterBasedOperation(std::string url);
|
||||
|
||||
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);
|
||||
static std::string upper_string(const std::string& str);
|
||||
size_t getDate();
|
||||
std::string getExePath();
|
||||
|
||||
int compareVersions(std::string Version1, std::string Version2);
|
||||
|
||||
int writeToFile(std::vector<std::string> paths, std::string text);
|
||||
|
||||
static std::string getCurlVersion();
|
||||
|
||||
std::string sock5Proxy;
|
||||
private:
|
||||
bool debugMode = false;
|
||||
};
|
||||
|
||||
#endif // MANAGEPAGE_H
|
||||
#ifndef MANAGEPAGE_H
|
||||
#define MANAGEPAGE_H
|
||||
|
||||
|
||||
#include "accountManager.h"
|
||||
#include "parameterManager.h" // for isNumber
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "./../include/curl/curl.h"
|
||||
#include <windows.h>
|
||||
|
||||
//----------------------?????????????????
|
||||
#define noSLLCheck
|
||||
|
||||
#else
|
||||
#include "curl/curl.h"
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
#include <unistd.h> // sleep
|
||||
#include <algorithm>
|
||||
#include <ctime> // std::time, localtime ...
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
struct checkNameRply {
|
||||
std::string name;
|
||||
PAGE pageInUse;
|
||||
enum STATUS { SUCCESS, FAILED, NOTHING_FOUND, MULTIPLE_OPTIONS, NO_WORKING_PAGE }
|
||||
status;
|
||||
|
||||
|
||||
checkNameRply(const std::string &name, const PAGE &p, const checkNameRply::STATUS &s )
|
||||
: name(name), pageInUse(p), status(s) {}
|
||||
};
|
||||
|
||||
|
||||
class PageManager
|
||||
{
|
||||
public:
|
||||
PageManager(std::string sock5ProxyOnlyAddress = "127.0.0.1:9150");
|
||||
~PageManager();
|
||||
|
||||
void setProxy(std::string ip, int port);
|
||||
void setDebugMode(bool status);
|
||||
|
||||
void get_terminal_size(int& width);
|
||||
|
||||
Reply getServerRequest(std::string protocol, std::string Url, bool useCookies = false, std::string data = "", bool generateCookieFile = false, bool UrlAfterRedirectOnlyNeeded = false, std::string cookieFilePath = "");
|
||||
int downLoadToFile(std::string filePath, std::string url);
|
||||
|
||||
int login(PAGE page, Account account, std::string cookieFilePath);
|
||||
Reply getUrlAfterRedirect(std::string p, std::string Url, std::string cookieFilePath);
|
||||
checkNameRply checkName(std::vector<PAGE> &pages, std::string Name, bool useFirstPage, std::vector<std::string> &outPutFilePaths /*for replacement*/);
|
||||
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, bool withWarnMsg);
|
||||
std::string getLinkAfterHosterBasedOperation(std::string url);
|
||||
|
||||
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);
|
||||
static std::string upper_string(const std::string& str);
|
||||
size_t getDate();
|
||||
std::string getExePath();
|
||||
|
||||
int compareVersions(std::string Version1, std::string Version2);
|
||||
|
||||
int writeToFile(std::vector<std::string> paths, std::string text);
|
||||
|
||||
static std::string getCurlVersion();
|
||||
|
||||
std::string sock5Proxy;
|
||||
private:
|
||||
bool debugMode = false;
|
||||
};
|
||||
|
||||
#endif // MANAGEPAGE_H
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,279 +1,279 @@
|
||||
#ifndef PARAMETERMANAGER_H
|
||||
#define PARAMETERMANAGER_H
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef __linux__
|
||||
#ifndef _WIN32
|
||||
#error "Error Invalid System: Only for Linux and Windows systems!"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <getopt.h>
|
||||
#include <string.h> // strlen
|
||||
#include <sstream>
|
||||
#include <sys/stat.h>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#include <limits.h> // PATH_MAX
|
||||
#include <unistd.h> // readlink()
|
||||
#include <dirent.h>
|
||||
|
||||
|
||||
|
||||
#define UpdaterCloudUrlWithPath "https://cloud.obermui.de/s/tXz7SWdaPJ7TacZ/download?path=%2F&files="
|
||||
#define SecondUpdaterCloudUrlWithPath "https://snew4.obermui.de/download?path=%2F&files="
|
||||
#define VERSION "5.2.1"
|
||||
#define DEFAULT_FILE_VERSION "2.3"
|
||||
|
||||
//default, anime, normal,
|
||||
//suche: für jede katego. eine
|
||||
//zu beginn, erst eiunmal serie suchen
|
||||
|
||||
|
||||
|
||||
|
||||
enum Modus {
|
||||
EXIT = -1,
|
||||
DEFAULT_MODUS = 0,
|
||||
DIRECT_LINK_MODUS = 1,
|
||||
SEARCH_MODUS = 2,
|
||||
INFO_MODUS = 3,
|
||||
NEWS_MODUS = 4,
|
||||
UPDATE_MODUS = 5,
|
||||
REMOVE_SETTINGS_AND_CACHE_MODUS = 6,
|
||||
PRINT_LOG_FILE_MODUS
|
||||
|
||||
};
|
||||
|
||||
struct PAGE {
|
||||
PAGE() {}
|
||||
PAGE( std::string protocol, std::string url, std::string nameID, std::string urlAphabetSerienList, std::string urlDir )
|
||||
: protocol(protocol), name_id(nameID), url(url), urlAlphabetSerienList(urlAphabetSerienList), UrlDir(urlDir)
|
||||
{
|
||||
|
||||
}
|
||||
std::string protocol, name_id, url, urlAlphabetSerienList, UrlDir;
|
||||
};
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
//Wichtig nach MODUS UND PAGE DECLARATION
|
||||
#include "pageManager.h"
|
||||
|
||||
|
||||
struct Settings {
|
||||
|
||||
const std::string programName = "S_New4";
|
||||
const PAGE _sto = PAGE( "https://", "s.to", "Normale_Serien", "/serien-alphabet", "/serie/stream/"),
|
||||
_stoIP = PAGE( "", "190.115.18.20", "Normale_Serien", "/serien-alphabet", "/serie/stream/"),
|
||||
serienstreamto = PAGE("https://", "serienstream.to", "Normale_Serien", "/serien-alphabet", "/serie/stream/"),
|
||||
seriencam = PAGE("https://", "serien.cam", "Normale_Serien", "/serien-alphabet", "/serie/stream/"),
|
||||
// _serienstreamsx = PAGE( "https://", "serienstream.sx", "Normale_Serien", "/serien-alphabet", "/serie/stream/"),
|
||||
|
||||
_anicio = PAGE( "https://" , "AniWorld.to", "Animes", "/animes-alphabet", "/anime/stream/");
|
||||
const PAGE pagesALL[5] = { _sto, _anicio, _stoIP, /*_serienstreamsx,*/ seriencam, serienstreamto };
|
||||
|
||||
std::vector<PAGE> pagesInUse; // Priority sorted
|
||||
bool useFirstPage = false;
|
||||
|
||||
PAGE direktLink_explizitPage;
|
||||
|
||||
|
||||
Settings() {
|
||||
for(const auto &e : pagesALL)
|
||||
pagesInUse.push_back( e );
|
||||
}
|
||||
|
||||
// Wenn das Betriebsystem x86 ist:
|
||||
#if defined (_X86_) || defined (__amd64__) || defined (_M_IX86)
|
||||
// Wenn das Betriebsystem LINUX ist und 64 Bit ist:
|
||||
#if defined (__linux) && ( defined (_LP64) || defined (__LP64__))
|
||||
const std::string VersionFileName = std::string("Version-LINx86.txt");
|
||||
const std::string ProgrammFileName = std::string("S_New4-LINx86");
|
||||
#else
|
||||
//Wenn das Betriebsystem Windows ist und 64 Bit ist
|
||||
#if defined (_WIN64)
|
||||
const std::string VersionFileName = std::string("Version-WINx86.txt");
|
||||
const std::string ProgrammFileName = std::string("S_New4-WINx86.exe");
|
||||
#else
|
||||
//Ungültiges Betriebsystem => Error
|
||||
#error Kein Windows oder Linux 64 Bit System: Der Updater Fuktion wird nicht Funktionieren! Remove this Line in the Code to use S_New4 without the Updater. ( But your System must be Windows or Linux )
|
||||
const std::string VersionFileName = "";
|
||||
const std::string ProgrammFileName = "";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//Nicht x86 Architekture
|
||||
#else
|
||||
//Raspberry Pi -> ARMv6 -> 32Bit
|
||||
#if defined(__ARM_ARCH_6__) && defined (__linux)
|
||||
const std::string VersionFileName = std::string("Version-LIN-ARMv6.txt");
|
||||
const std::string ProgrammFileName = std::string("S_New4-LIN-ARMv6");
|
||||
#else
|
||||
#error Falsche Architektur: Der Updater Fuktion wird nicht Funktionieren! Remove this Line in the Code to use S_New4 without the Updater. ( But your System must be Windows or Linux )
|
||||
const std::string VersionFileName = "";
|
||||
const std::string ProgrammFileName = "";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
std::string name,
|
||||
accountFilePath = "",
|
||||
accountNumberPath= "",
|
||||
cookieFilePath = "",
|
||||
serienListPath = "",
|
||||
|
||||
lastUpdateDateFilePath = "",
|
||||
lastProgrammUpdateDateFilePath = "",
|
||||
|
||||
|
||||
configDir="",
|
||||
cacheDir="",
|
||||
logFilePath="",
|
||||
|
||||
defaultsFilePath = "",
|
||||
proxy_ip = "127.0.0.1",
|
||||
languages = "GerDub,GerSub,Eng,",
|
||||
genaueHoster = "",
|
||||
version = VERSION,
|
||||
defaultFileVersion= DEFAULT_FILE_VERSION,
|
||||
default_checkPath = "",
|
||||
default_Searchmuster = "S%Staffel%E%Folge%",
|
||||
argv0;
|
||||
|
||||
std::vector<std::string> outputFilePaths;
|
||||
|
||||
|
||||
Modus modus = Modus::EXIT;
|
||||
bool colorless = false,
|
||||
debugMode = false,
|
||||
search_IgnoreUpperLower = true,
|
||||
search_wantUpdate = false,
|
||||
search_show_othernames = false,
|
||||
askForEveryDir = true,
|
||||
skipEpisodenNameOutput = false,
|
||||
showLastUpdate = false;
|
||||
|
||||
int startEpisode = 1,
|
||||
stopEpisode = 0,
|
||||
startSeason = 1,
|
||||
stopSeason = 0,
|
||||
proxy_port = 9050,
|
||||
default_maxDirs = 20,
|
||||
updateWarningDays = 10,
|
||||
|
||||
programmUpdateWarningDays = 20;
|
||||
|
||||
|
||||
char pathSymbol = '/';
|
||||
char wrongPathSymbol = '\\';
|
||||
unsigned maxThreads = 0;
|
||||
|
||||
enum COLOR {
|
||||
NO_COLOR = 0,
|
||||
Black = 30,
|
||||
Dark_Gray = 90,
|
||||
Red = 31,
|
||||
Light_Red = 91,
|
||||
Green = 32,
|
||||
Light_Green = 92,
|
||||
Brown_Orange = 33,
|
||||
Yellow = 93,
|
||||
Blue = 34,
|
||||
Light_Blue = 94,
|
||||
Purple = 35,
|
||||
Light_Purple = 95,
|
||||
Cyan = 36,
|
||||
Light_Cyan = 96,
|
||||
Light_Gray = 37,
|
||||
White = 97
|
||||
|
||||
};
|
||||
std::string setPColor(const COLOR &color) {
|
||||
return ( (colorless) ? "" : "\033[" + std::to_string(color) +"m" );
|
||||
}
|
||||
std::string resetPColor() {
|
||||
return ( (colorless) ? "" : "\033[0m" );
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
std::string replace(std::string str, std::string substr1, std::string substr2);
|
||||
|
||||
int manageParameter(Settings &settings, int argc, char ** argv);
|
||||
int loadDefaulOptions(Settings & settings);
|
||||
std::vector<std::string> compare(std::string All_Options_with_komma_between, std::string input);
|
||||
bool isSame(char ** argv, std::string FunktionName);
|
||||
bool isNumber(std::string number);
|
||||
|
||||
int setPaths(Settings &settings);
|
||||
|
||||
bool fileExists (const std::string& name);
|
||||
bool dirExists(std::string dir);
|
||||
bool nothingExists(std::string path);
|
||||
|
||||
bool createDirIsOk(std::string path);
|
||||
bool makePathIsOk(std::string path);
|
||||
bool removeDirIsOk(std::string path, Settings *settings, bool askForDelete);
|
||||
|
||||
int unterOption_help(Settings &settings);
|
||||
void unterOption_printVersion(Settings &settings);
|
||||
|
||||
int unterOption_default(Settings * settings, int argc, char **argv);
|
||||
void unterOption_default_help(std::string programName);
|
||||
|
||||
int unterOption_url(Settings * settings, int argc, char **argv);
|
||||
void unterOption_url_help(std::string programName);
|
||||
|
||||
int unterOption_search(Settings * settings, int argc, char **argv);
|
||||
void unterOption_search_help(std::string programName);
|
||||
|
||||
int unterOption_info(Settings * settings, int argc, char **argv);
|
||||
void unterOption_info_help(std::string programName);
|
||||
|
||||
void unterOption_clean(Settings * settings, int argc, char **argv);
|
||||
|
||||
int unterOption_printJD2_renameSkript(Settings * settings, int, char **);
|
||||
|
||||
|
||||
int unterOption_news(Settings * settings, int argc, char **argv);
|
||||
void unterOption_news_help(std::string programName);
|
||||
|
||||
int unterOption_update(Settings * settings, int argc, char **argv);
|
||||
void unterOption_update_help(std::string programName);
|
||||
|
||||
int unterOption_RemoveSettings_or_CacheDir(Settings * settings, int argc, char **argv);
|
||||
void unterOption_RemoveSettings_or_CacheDire_help(std::string programName);
|
||||
|
||||
int unterOption_printLogFile(Settings * settings, int argc, char **argv);
|
||||
void unterOption_printLogFile(std::string programName);
|
||||
|
||||
int setS5ProxytoSettings(Settings &settings, std::string optarg);
|
||||
int setUpInternetPages(Settings &settings, std::string optarg);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // PARAMETERMANAGER_H
|
||||
#ifndef PARAMETERMANAGER_H
|
||||
#define PARAMETERMANAGER_H
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef __linux__
|
||||
#ifndef _WIN32
|
||||
#error "Error Invalid System: Only for Linux and Windows systems!"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <getopt.h>
|
||||
#include <string.h> // strlen
|
||||
#include <sstream>
|
||||
#include <sys/stat.h>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#include <limits.h> // PATH_MAX
|
||||
#include <unistd.h> // readlink()
|
||||
#include <dirent.h>
|
||||
|
||||
|
||||
|
||||
#define UpdaterCloudUrlWithPath "https://cloud.obermui.de/s/tXz7SWdaPJ7TacZ/download?path=%2F&files="
|
||||
#define SecondUpdaterCloudUrlWithPath "https://snew4.obermui.de/download?path=%2F&files="
|
||||
#define VERSION "5.2.1"
|
||||
#define DEFAULT_FILE_VERSION "2.3"
|
||||
|
||||
//default, anime, normal,
|
||||
//suche: für jede katego. eine
|
||||
//zu beginn, erst eiunmal serie suchen
|
||||
|
||||
|
||||
|
||||
|
||||
enum Modus {
|
||||
EXIT = -1,
|
||||
DEFAULT_MODUS = 0,
|
||||
DIRECT_LINK_MODUS = 1,
|
||||
SEARCH_MODUS = 2,
|
||||
INFO_MODUS = 3,
|
||||
NEWS_MODUS = 4,
|
||||
UPDATE_MODUS = 5,
|
||||
REMOVE_SETTINGS_AND_CACHE_MODUS = 6,
|
||||
PRINT_LOG_FILE_MODUS
|
||||
|
||||
};
|
||||
|
||||
struct PAGE {
|
||||
PAGE() {}
|
||||
PAGE( std::string protocol, std::string url, std::string nameID, std::string urlAphabetSerienList, std::string urlDir )
|
||||
: protocol(protocol), name_id(nameID), url(url), urlAlphabetSerienList(urlAphabetSerienList), UrlDir(urlDir)
|
||||
{
|
||||
|
||||
}
|
||||
std::string protocol, name_id, url, urlAlphabetSerienList, UrlDir;
|
||||
};
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
//Wichtig nach MODUS UND PAGE DECLARATION
|
||||
#include "pageManager.h"
|
||||
|
||||
|
||||
struct Settings {
|
||||
|
||||
const std::string programName = "S_New4";
|
||||
const PAGE _sto = PAGE( "https://", "s.to", "Normale_Serien", "/serien-alphabet", "/serie/stream/"),
|
||||
_stoIP = PAGE( "http://", "190.115.18.20", "Normale_Serien", "/serien-alphabet", "/serie/stream/"),
|
||||
serienstreamto = PAGE("https://", "serienstream.to", "Normale_Serien", "/serien-alphabet", "/serie/stream/"),
|
||||
seriencam = PAGE("https://", "serien.cam", "Normale_Serien", "/serien-alphabet", "/serie/stream/"),
|
||||
|
||||
_anicio = PAGE( "https://" , "aniworld.to", "Animes", "/animes-alphabet", "/anime/stream/");
|
||||
const PAGE pagesALL[5] = { _sto, _anicio, _stoIP, /*_serienstreamsx,*/ seriencam, serienstreamto };
|
||||
|
||||
std::vector<PAGE> pagesInUse; // Priority sorted
|
||||
bool useFirstPage = false;
|
||||
|
||||
PAGE direktLink_explizitPage;
|
||||
|
||||
|
||||
Settings() {
|
||||
for(const auto &e : pagesALL)
|
||||
pagesInUse.push_back( e );
|
||||
}
|
||||
|
||||
// Wenn das Betriebsystem x86 ist:
|
||||
#if defined (_X86_) || defined (__amd64__) || defined (_M_IX86)
|
||||
// Wenn das Betriebsystem LINUX ist und 64 Bit ist:
|
||||
#if defined (__linux) && ( defined (_LP64) || defined (__LP64__))
|
||||
const std::string VersionFileName = std::string("Version-LINx86.txt");
|
||||
const std::string ProgrammFileName = std::string("S_New4-LINx86");
|
||||
#else
|
||||
//Wenn das Betriebsystem Windows ist und 64 Bit ist
|
||||
#if defined (_WIN64)
|
||||
const std::string VersionFileName = std::string("Version-WINx86.txt");
|
||||
const std::string ProgrammFileName = std::string("S_New4-WINx86.exe");
|
||||
#else
|
||||
//Ungültiges Betriebsystem => Error
|
||||
#error Kein Windows oder Linux 64 Bit System: Der Updater Fuktion wird nicht Funktionieren! Remove this Line in the Code to use S_New4 without the Updater. ( But your System must be Windows or Linux )
|
||||
const std::string VersionFileName = "";
|
||||
const std::string ProgrammFileName = "";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//Nicht x86 Architekture
|
||||
#else
|
||||
//Raspberry Pi -> ARMv6 -> 32Bit
|
||||
#if defined(__ARM_ARCH_6__) && defined (__linux)
|
||||
const std::string VersionFileName = std::string("Version-LIN-ARMv6.txt");
|
||||
const std::string ProgrammFileName = std::string("S_New4-LIN-ARMv6");
|
||||
#else
|
||||
#error Falsche Architektur: Der Updater Fuktion wird nicht Funktionieren! Remove this Line in the Code to use S_New4 without the Updater. ( But your System must be Windows or Linux )
|
||||
const std::string VersionFileName = "";
|
||||
const std::string ProgrammFileName = "";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
std::string name,
|
||||
accountFilePath = "",
|
||||
accountNumberPath= "",
|
||||
cookieFilePath = "",
|
||||
serienListPath = "",
|
||||
|
||||
lastUpdateDateFilePath = "",
|
||||
lastProgrammUpdateDateFilePath = "",
|
||||
|
||||
|
||||
configDir="",
|
||||
cacheDir="",
|
||||
logFilePath="",
|
||||
|
||||
defaultsFilePath = "",
|
||||
proxy_ip = "127.0.0.1",
|
||||
languages = "GerDub,GerSub,Eng,",
|
||||
genaueHoster = "",
|
||||
version = VERSION,
|
||||
defaultFileVersion= DEFAULT_FILE_VERSION,
|
||||
default_checkPath = "",
|
||||
default_Searchmuster = "S%Staffel%E%Folge%",
|
||||
argv0,
|
||||
downloadCoverPfad;
|
||||
|
||||
std::vector<std::string> outputFilePaths;
|
||||
|
||||
|
||||
Modus modus = Modus::EXIT;
|
||||
bool colorless = false,
|
||||
debugMode = false,
|
||||
search_IgnoreUpperLower = true,
|
||||
search_wantUpdate = false,
|
||||
search_show_othernames = false,
|
||||
askForEveryDir = true,
|
||||
skipEpisodenNameOutput = false,
|
||||
showLastUpdate = false;
|
||||
|
||||
int startEpisode = 1,
|
||||
stopEpisode = 0,
|
||||
startSeason = 1,
|
||||
stopSeason = 0,
|
||||
proxy_port = 9050,
|
||||
default_maxDirs = 20,
|
||||
updateWarningDays = 10,
|
||||
|
||||
programmUpdateWarningDays = 20;
|
||||
|
||||
|
||||
char pathSymbol = '/';
|
||||
char wrongPathSymbol = '\\';
|
||||
unsigned maxThreads = 0;
|
||||
|
||||
enum COLOR {
|
||||
NO_COLOR = 0,
|
||||
Black = 30,
|
||||
Dark_Gray = 90,
|
||||
Red = 31,
|
||||
Light_Red = 91,
|
||||
Green = 32,
|
||||
Light_Green = 92,
|
||||
Brown_Orange = 33,
|
||||
Yellow = 93,
|
||||
Blue = 34,
|
||||
Light_Blue = 94,
|
||||
Purple = 35,
|
||||
Light_Purple = 95,
|
||||
Cyan = 36,
|
||||
Light_Cyan = 96,
|
||||
Light_Gray = 37,
|
||||
White = 97
|
||||
|
||||
};
|
||||
std::string setPColor(const COLOR &color) {
|
||||
return ( (colorless) ? "" : "\033[" + std::to_string(color) +"m" );
|
||||
}
|
||||
std::string resetPColor() {
|
||||
return ( (colorless) ? "" : "\033[0m" );
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
std::string replace(std::string str, std::string substr1, std::string substr2);
|
||||
|
||||
int manageParameter(Settings &settings, int argc, char ** argv);
|
||||
int loadDefaulOptions(Settings & settings);
|
||||
std::vector<std::string> compare(std::string All_Options_with_komma_between, std::string input);
|
||||
bool isSame(char ** argv, std::string FunktionName);
|
||||
bool isNumber(std::string number);
|
||||
|
||||
int setPaths(Settings &settings);
|
||||
|
||||
bool fileExists (const std::string& name);
|
||||
bool dirExists(std::string dir);
|
||||
bool nothingExists(std::string path);
|
||||
|
||||
bool createDirIsOk(std::string path);
|
||||
bool makePathIsOk(std::string path);
|
||||
bool removeDirIsOk(std::string path, Settings *settings, bool askForDelete);
|
||||
|
||||
int unterOption_help(Settings &settings);
|
||||
void unterOption_printVersion(Settings &settings);
|
||||
|
||||
int unterOption_default(Settings * settings, int argc, char **argv);
|
||||
void unterOption_default_help(std::string programName);
|
||||
|
||||
int unterOption_url(Settings * settings, int argc, char **argv);
|
||||
void unterOption_url_help(std::string programName);
|
||||
|
||||
int unterOption_search(Settings * settings, int argc, char **argv);
|
||||
void unterOption_search_help(std::string programName);
|
||||
|
||||
int unterOption_info(Settings * settings, int argc, char **argv);
|
||||
void unterOption_info_help(std::string programName);
|
||||
|
||||
void unterOption_clean(Settings * settings, int argc, char **argv);
|
||||
|
||||
int unterOption_printJD2_renameSkript(Settings * settings, int, char **);
|
||||
|
||||
|
||||
int unterOption_news(Settings * settings, int argc, char **argv);
|
||||
void unterOption_news_help(std::string programName);
|
||||
|
||||
int unterOption_update(Settings * settings, int argc, char **argv);
|
||||
void unterOption_update_help(std::string programName);
|
||||
|
||||
int unterOption_RemoveSettings_or_CacheDir(Settings * settings, int argc, char **argv);
|
||||
void unterOption_RemoveSettings_or_CacheDire_help(std::string programName);
|
||||
|
||||
int unterOption_printLogFile(Settings * settings, int argc, char **argv);
|
||||
void unterOption_printLogFile(std::string programName);
|
||||
|
||||
int setS5ProxytoSettings(Settings &settings, std::string optarg);
|
||||
int setUpInternetPages(Settings &settings, std::string optarg);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // PARAMETERMANAGER_H
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,72 +1,72 @@
|
||||
#ifndef MANAGEPROGRAM_H
|
||||
#define MANAGEPROGRAM_H
|
||||
|
||||
|
||||
|
||||
|
||||
//#include "pageManager.h"
|
||||
#include "parameterManager.h"
|
||||
//#include "accountManager.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <pthread.h>
|
||||
|
||||
|
||||
struct ThreadData
|
||||
{
|
||||
ThreadData(unsigned id, pthread_t init, std::string nameinUrl,int exitStateInit, Settings * settings, AccountManager * accountMg, PageManager * pM, PAGE p)
|
||||
: id(id), page(p), thread(init), nameInUrl(nameinUrl), exitState(exitStateInit), settings(settings), accountManager(accountMg), pageManager(pM) {}
|
||||
|
||||
unsigned id;
|
||||
PAGE page;
|
||||
pthread_t thread;
|
||||
std::string nameInUrl, returnValue;
|
||||
int staffel, folge, exitState;
|
||||
Settings * settings;
|
||||
AccountManager * accountManager;
|
||||
PageManager * pageManager;
|
||||
|
||||
void * setState(int state) {
|
||||
this->exitState = state;
|
||||
return nullptr;
|
||||
}
|
||||
void setData(int staffel, int folge) { this->staffel = staffel; this->folge = folge; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
class ProgramManager
|
||||
{
|
||||
public:
|
||||
ProgramManager();
|
||||
~ProgramManager();
|
||||
int start(Settings *setting);
|
||||
int listDir(std::string &list, std::string path, int maxDepth, bool debugMode);
|
||||
|
||||
private:
|
||||
int defaultModus(Settings * settings);
|
||||
int directLinkModus(Settings * settings);
|
||||
int searchModus(Settings * settings, std::string *saveTo = nullptr, bool noPrint = false);
|
||||
int infoModus(Settings * settings);
|
||||
int newsModus(Settings *settings);
|
||||
int updateModus(Settings *settings);
|
||||
int cleanUpSettingsAndCache(Settings *settings);
|
||||
|
||||
|
||||
PageManager pageManager;
|
||||
std::vector<ThreadData*> threadList;
|
||||
unsigned nextThread;
|
||||
|
||||
int convertLink(PAGE page, std::string redirectLink, AccountManager *accountManager, Settings * settings, int Staffel = -1, int Folge = -1, std::string allLinks = "NOT_EMPTY");
|
||||
int searchModus_update(Settings * settings);
|
||||
int waitForThreads();
|
||||
int sucheNach_1_Serien(Settings *settings, PageManager &pageManager, checkNameRply &newNameAndPage);
|
||||
int checkLastUpdate(Settings * settings, ssize_t *days);
|
||||
|
||||
int checkLastProgrammUpdate(Settings *settings);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // MANAGEPROGRAM_H
|
||||
#ifndef MANAGEPROGRAM_H
|
||||
#define MANAGEPROGRAM_H
|
||||
|
||||
|
||||
|
||||
|
||||
//#include "pageManager.h"
|
||||
#include "parameterManager.h"
|
||||
//#include "accountManager.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <pthread.h>
|
||||
|
||||
|
||||
struct ThreadData
|
||||
{
|
||||
ThreadData(unsigned id, pthread_t init, std::string nameinUrl,int exitStateInit, Settings * settings, AccountManager * accountMg, PageManager * pM, PAGE p)
|
||||
: id(id), page(p), thread(init), nameInUrl(nameinUrl), exitState(exitStateInit), settings(settings), accountManager(accountMg), pageManager(pM) {}
|
||||
|
||||
unsigned id;
|
||||
PAGE page;
|
||||
pthread_t thread;
|
||||
std::string nameInUrl, returnValue;
|
||||
int staffel, folge, exitState;
|
||||
Settings * settings;
|
||||
AccountManager * accountManager;
|
||||
PageManager * pageManager;
|
||||
|
||||
void * setState(int state) {
|
||||
this->exitState = state;
|
||||
return nullptr;
|
||||
}
|
||||
void setData(int staffel, int folge) { this->staffel = staffel; this->folge = folge; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
class ProgramManager
|
||||
{
|
||||
public:
|
||||
ProgramManager();
|
||||
~ProgramManager();
|
||||
int start(Settings *setting);
|
||||
int listDir(std::string &list, std::string path, int maxDepth, bool debugMode);
|
||||
|
||||
private:
|
||||
int defaultModus(Settings * settings);
|
||||
int directLinkModus(Settings * settings);
|
||||
int searchModus(Settings * settings, std::string *saveTo = nullptr, bool noPrint = false);
|
||||
int infoModus(Settings * settings);
|
||||
int newsModus(Settings *settings);
|
||||
int updateModus(Settings *settings);
|
||||
int cleanUpSettingsAndCache(Settings *settings);
|
||||
|
||||
|
||||
PageManager pageManager;
|
||||
std::vector<ThreadData*> threadList;
|
||||
unsigned nextThread;
|
||||
|
||||
int convertLink(PAGE page, std::string redirectLink, AccountManager *accountManager, Settings * settings, int Staffel = -1, int Folge = -1, std::string allLinks = "NOT_EMPTY");
|
||||
int searchModus_update(Settings * settings);
|
||||
int waitForThreads();
|
||||
int sucheNach_1_Serien(Settings *settings, PageManager &pageManager, checkNameRply &newNameAndPage);
|
||||
int checkLastUpdate(Settings * settings, ssize_t *days);
|
||||
|
||||
int checkLastProgrammUpdate(Settings *settings);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // MANAGEPROGRAM_H
|
||||
|
Loading…
Reference in New Issue
Block a user