aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <donaldshan1@outlook.com>2023-06-20 02:22:01 -0700
committerPinapelz <donaldshan1@outlook.com>2023-06-20 02:22:01 -0700
commitc07f15e8de2c8d9e183be8e24f66759c02b496e3 (patch)
tree79f08445e2ee3bef6490d12bc666b87d75c0879f
parent70237b5a5d82e8425eb5870a975bde497a6def08 (diff)
fix: missing youtube local option
-rw-r--r--config.ini1
-rw-r--r--nijitrack.py23
2 files changed, 14 insertions, 10 deletions
diff --git a/config.ini b/config.ini
index 17217c1..8fda670 100644
--- a/config.ini
+++ b/config.ini
@@ -15,6 +15,7 @@ daily = 24h_historical
[API]
holodex = HOLODEXAPI
+youtube = YOUTUBEAPI
[PATH]
root_html = stats
diff --git a/nijitrack.py b/nijitrack.py
index 3e7393e..a137edb 100644
--- a/nijitrack.py
+++ b/nijitrack.py
@@ -8,6 +8,7 @@ from webapi.holodex import HolodexAPI
from webapi.youtube import YouTubeAPI
from decorators import *
import html_builders.builder as builder
+import sys
@@ -60,9 +61,8 @@ def generate_individual_pages(server: SQLHandler, data: list):
if not os.path.exists("tables"):
os.mkdir("tables")
for channel in data:
- # builder.build_individual_page(server, CONFIG, channel)
+ builder.build_individual_page(server, CONFIG, channel)
builder.build_table_page(server, CONFIG, channel)
- quit()
@@ -77,17 +77,20 @@ def holodex_generation(server: SQLHandler):
record_subscriber_data(holodex.get_subscriber_data())
return holodex.get_generated_channel_data()
-
+@log("Running YouTube Generation")
+def youtube_generation(server: SQLHandler):
+ ytapi = YouTubeAPI(CONFIG["API"]["youtube"])
+ server.clear_table(CONFIG["TABLES"]["live"])
+ server.reset_auto_increment(CONFIG["TABLES"]["live"])
+ data = ytapi.get_data_all_channels(fs.get_local_channels())
+ record_subscriber_data(data)
+ return data
if __name__ == "__main__":
server = SQLHandler(CONFIG["SQL"]["host"], CONFIG["SQL"]["user"], CONFIG["SQL"]["password"], CONFIG["SQL"]["database"])
- # initialize_database(server)
- channel_data = holodex_generation(server)
+ initialize_database(server)
+ channel_data = holodex_generation(server) # channel_data = youtube_generation(server)
generate_individual_pages(server, channel_data)
- # builder.build_ranking_page(server, CONFIG)
-
-
-
-
+ builder.build_ranking_page(server, CONFIG)
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage