added stats
This commit is contained in:
1 parent
ad2a043aad
commit
9ba4500c27
3 files changed
+12
-6
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import time
|
||||
from subprocess import Popen
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from os import system, getenv, name
|
||||
from os import getenv, name
|
||||
from reddit.subreddit import get_subreddit_threads
|
||||
from utils.cleanup import cleanup
|
||||
from utils.console import print_markdown, print_step
|
||||
@@ -47,7 +49,7 @@ def run_many(times):
|
||||
print_step(
|
||||
f'on the {x}{("st" if x == 1 else ("nd" if x == 2 else ("rd" if x == 3 else "th")))} iteration of {times}') # correct 1st 2nd 3rd 4th 5th....
|
||||
main()
|
||||
system('cls' if name == 'nt' else 'clear') # clear terminal
|
||||
Popen('cls' if name == 'nt' else 'clear', shell=True).wait()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
+7
-4
@@ -51,11 +51,14 @@ def get_subreddit_threads():
|
||||
submission = check_done(submission)
|
||||
if submission is None:
|
||||
return get_subreddit_threads() # submission already done. rerun
|
||||
print_substep(f"Video will be: {submission.title} :thumbsup:")
|
||||
|
||||
print_substep(
|
||||
f'subreddit thread is: {submission.title}\n(if you dont like this, you can change it by exiting and rerunning the program)')
|
||||
upvotes = submission.score
|
||||
ratio = submission.upvote_ratio * 100
|
||||
num_comments = submission.num_comments
|
||||
|
||||
print_substep(f"Video will be: {submission.title} :thumbsup:", style='bold green')
|
||||
print_substep(f"Thread has " + str(upvotes) + " upvotes", style='bold blue')
|
||||
print_substep(f"Thread has a upvote ratio of " + str(ratio) + "%", style='bold blue')
|
||||
print_substep(f"Thread has " + str(num_comments) + " comments", style='bold blue')
|
||||
environ["VIDEO_TITLE"] = str(textify(submission.title)) # todo use global instend of env vars
|
||||
environ["VIDEO_ID"] = str(textify(submission.id))
|
||||
try:
|
||||
|
||||
@@ -2,6 +2,7 @@ import json
|
||||
from os import getenv
|
||||
from pathlib import Path
|
||||
|
||||
from playwright.async_api import async_playwright
|
||||
from playwright.sync_api import sync_playwright, ViewportSize
|
||||
from rich.progress import track
|
||||
|
||||
|
||||
Reference in new issue
Block a user