mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-05-01 07:51:10 -05:00
lstrip text html check
This commit is contained in:
parent
30d1aeb5a1
commit
2e7c3399e4
@ -594,7 +594,7 @@ class ASCII(callbacks.Plugin):
|
|||||||
if url.startswith("https://paste.ee/p/"):
|
if url.startswith("https://paste.ee/p/"):
|
||||||
url = re.sub("https://paste.ee/p/", "https://paste.ee/r/", url)
|
url = re.sub("https://paste.ee/p/", "https://paste.ee/r/", url)
|
||||||
file = requests.get(url)
|
file = requests.get(url)
|
||||||
if "<!DOCTYPE html>" in file.text.splitlines()[:10]:
|
if "<!DOCTYPE html>" in file.text.lstrip().splitlines()[:10]:
|
||||||
irc.reply("Error: ansi2irc requires a text file as input.", private=False, notice=False)
|
irc.reply("Error: ansi2irc requires a text file as input.", private=False, notice=False)
|
||||||
return
|
return
|
||||||
elif url.endswith(".txt") or url.startswith("https://pastebin.com/raw/") or url.startswith("https://paste.ee/r/"):
|
elif url.endswith(".txt") or url.startswith("https://pastebin.com/raw/") or url.startswith("https://paste.ee/r/"):
|
||||||
@ -636,7 +636,7 @@ class ASCII(callbacks.Plugin):
|
|||||||
delay = self.registryValue('delay', msg.args[0])
|
delay = self.registryValue('delay', msg.args[0])
|
||||||
try:
|
try:
|
||||||
file = requests.get(url)
|
file = requests.get(url)
|
||||||
if "<!DOCTYPE html>" in file.text.splitlines()[:10]:
|
if "<!DOCTYPE html>" in file.text.lstrip().splitlines()[:10]:
|
||||||
irc.reply("Error: ansi2irc requires a text file as input.", private=False, notice=False)
|
irc.reply("Error: ansi2irc requires a text file as input.", private=False, notice=False)
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user