aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2020-03-16 21:33:54 +0000
committerbloodstalker <thabogre@gmail.com>2020-03-16 21:33:54 +0000
commitcae5bb06a83d6039de1aa62bf76120da5ef79f0c (patch)
treed11b24ab44171d7143389eeea648a13d0d77f3bd
parentupdate (diff)
downloadkaminokumo-cae5bb06a83d6039de1aa62bf76120da5ef79f0c.tar.gz
kaminokumo-cae5bb06a83d6039de1aa62bf76120da5ef79f0c.zip
update
-rwxr-xr-xkaminokumo31
1 files changed, 12 insertions, 19 deletions
diff --git a/kaminokumo b/kaminokumo
index dd76293..1220817 100755
--- a/kaminokumo
+++ b/kaminokumo
@@ -31,17 +31,19 @@ def mrg(url):
requests.packages.urllib3.disable_warnings()
resp = requests.get(url, verify=False)
soup = BeautifulSoup(resp.text, "lxml")
- res = soup.select("dd")
- if url == "https://chaturbate.com/anabellastar":
- search = res[6].text.split(",")
+ search = soup.find_all("div", class_="label")
+
+ Up_Time = str()
+ for elem in search:
+ if elem.string == "Last Broadcast:":
+ Up_Time = elem.next_sibling.next_sibling.string
+ print(elem.next_sibling.next_sibling)
+
+ if Up_Time.find("minutes") != -1:
+ print(url)
+ return True
else:
- search = res[7].text.split(",")
- length = len(search)
- for split in res[7].text.split(","):
- if length == 1:
- if split.find("minutes") != -1:
- return True
- return False
+ return False
def vocalize(sound):
subprocess.call([os.path.expanduser("~")+"/scripts/voice.sh", sound])
@@ -55,18 +57,9 @@ def premain(argparser):
if mrg(url["2"]):
print ("obk ", end="")
vocalize(os.path.expanduser("~") + "/scripts/mila/obkup.ogg")
- if mrg(url["3"]):
- print ("ddd ", end="")
- vocalize(os.path.expanduser("~") + "/scripts/mila/dddup.ogg")
- if mrg(url["4"]):
- print ("red ", end="")
- vocalize(os.path.expanduser("~") + "/scripts/mila/annaup.ogg")
if mrg(url["5"]):
print ("ls ", end="")
vocalize(os.path.expanduser("~") + "/scripts/mila/lisaup.ogg")
- if mrg(url["6"]):
- print ("vv ", end="")
- #vocalize(os.path.expanduser("~") + "/scripts/mila/lisaup.ogg")
def main():
argparser = Argparser()