Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
soopyc committed Mar 23, 2020
1 parent 8f6ae71 commit 18b665f
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 25 deletions.
51 changes: 30 additions & 21 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import traceback
from time import sleep
from time import time
from datetime import datetime

import requests
from colorama import Cursor
Expand All @@ -17,6 +18,7 @@
from colorama import Style

import gen

# DEBUG

version = ("0.", "1-alpha.", "3")
Expand Down Expand Up @@ -287,15 +289,16 @@ def check_time(oldt: int, newt: int, deadline: int = 172800):
try:
vote = vote_alph[-1]
except:
pass
if stats['video']['publishTStamp'] + config['deadline'] < i.published_at.timestamp():
vote = ''
if not stats['video']['publishTStamp'] + config['deadline'] >= i.published_at.timestamp():
stats['votes']['deadlined'] += 1 # Deadlined vote doesn't count.
# noinspection PyUnboundLocalVariable
if len(vote_alph) != 0 and vote in stats['alphs']:
stats['votes']['characters'][vote]['deadlined'] += 1 # Add 1 to the deadline count for the character
stats['votes']['characters'][vote]['total'] += 1 # Add 1 to the character's total vote count.
continue
elif not check(i.text.lower())[0]:
elif vote not in stats['alphs']:
# Check if vote is in alphs, better ngl, less bugs.
if check(i.text.lower())[1]:
# Check: (isValid, isVote)
stats["votes"]["total"] += 1
Expand Down Expand Up @@ -374,14 +377,17 @@ def check_time(oldt: int, newt: int, deadline: int = 172800):
f'{Fore.GREEN}Valid:{fchar[i]["valid"]}'.ljust(20) +
f'{Fore.YELLOW}Shiny:{fchar[i]["shiny"]}'.ljust(20) +
f'{Fore.RED}Dead.L:{fchar[i]["deadlined"]}')
genbr()
sayfill(f"VideoTime: {datetime.fromtimestamp(stats['video']['publishTStamp'])}")
sayfill(f"Deadline : {datetime.fromtimestamp(stats['video']['publishTStamp']+config['deadline'])}")
############################################################
# End session monitorings
requests.post(
"https://canary.discordapp.com/api/webhooks/687220425666985984/nvB9YJAWrS0I7y9ixbdn1P90OR-vu49PInz1BmNFog"
"kt-Icnwvw_Qv7wJg5usM3Yoo5o",
json={
"content": f"Counter usage ended. "
f"Session key: ``{session_id}``"
f"Session key: ``{session_id}``"
},
)

Expand Down
Binary file added sessions/session_09b1495e4de8e1288f4a.pickle
Binary file not shown.
Binary file added sessions/session_24a166384f88146ddca9.pickle
Binary file not shown.
Binary file added sessions/session_4b2c354be3545773dea8.pickle
Binary file not shown.
Binary file added sessions/session_519ebd0b5c49d57b30d5.pickle
Binary file not shown.
Binary file added sessions/session_52884239cc2bff4f318d.pickle
Binary file not shown.
Binary file added sessions/session_55927c6ac70937681879.pickle
Binary file not shown.
Binary file added sessions/session_bad192ad048ec6ab2fb5.pickle
Binary file not shown.
Binary file added sessions/session_e1ade5151853b779b686.pickle
Binary file not shown.

0 comments on commit 18b665f

Please sign in to comment.