-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.pyw
67 lines (42 loc) · 2.25 KB
/
main.pyw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# ------------------------------IMPORTS------------------------------
from util import gui
from PyQt5 import QtWidgets
import sys
import configparser
import os
# ------------------------------MAIN FUNCTION------------------------------
def main() -> None:
message = """<p>Welcome to my batch downloader for Nyaa.si!<br><br><br>
Make sure to write the title in Japanese.<br>
(e.g, instead of writing My Hero Academia, write Boku no Hero Academia).<br>
Uploaders often use the Japanese title, you won't find your anime otherwise.<br>
You may refer to MyAnimeList.net so you can get both translations.<br>
Don't worry, there is no case sensitivity.<br><br>
The uploader Erai-Raws specifies the season number for the title<br>
(e.g Boku no Hero Academia 5th Season).<br><br>
SubsPlease increases the episode number without using the season number<br>
(e.g Boku no Hero Academia - 103).<br><br>
Erai-Raws would be better for downloading one season,<br>
SubsPlease might be better for downloading many seasons at once.<br><br>
This program isn't made for downloading huge and old things Dragon Ball Z.<br>
Indeed, there are already multiple torrents that contains every single episodes.<br>
However, you can still download the latest episodes of things like One Piece.<br>
Only depends if the uploaders uploaded them episode by episode or not.<br><br>
If you find any bug, please let me know on my GitHub:<br>
<a href="https://github.com/marcpinet">https://github.com/marcpinet</a>.</p>"""
app = QtWidgets.QApplication([])
app.setApplicationName("NyaaDownloader")
MainWindow = QtWidgets.QMainWindow()
ui = gui.Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
config_dir = os.path.join(os.environ["APPDATA"], "NyaaDownloader")
config_path = os.path.join(config_dir, "config.ini")
config = configparser.ConfigParser()
config.read(config_path)
if not config.has_option("Settings", "ShowPopup") or config.getboolean("Settings", "ShowPopup"):
gui.Ui_MainWindow.show_info_popup(MainWindow, message, never_show_again=True)
sys.exit(app.exec_())
# ------------------------------MAIN CALL------------------------------
if __name__ == "__main__":
main()