Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions checks/utils/fetchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def matchGist(url):
return re.match(
r"(?i)\b((?:https?:(?:/{1,3}gist\.github\.com)/)((anonymous|[A-Za-z0-9-]{1,39})/)?([a-z0-9]{32}))", url)
r"(?i)^\b((?:https?:(?:/{1,3}gist\.github\.com)/)((anonymous|[A-Za-z0-9-]{1,39})/)?([a-z0-9]{32}))$", url)


def getGist(inputUrl):
Expand All @@ -35,7 +35,7 @@ def getDescriptionGist(gistObject):

def matchHaste(url):
return re.match(
r"(?i)\b((?:https?:(?:/{1,3}(www\.)?hastebin\.com)/)([a-z0-9]{10}))", url)
r"(?i)^\b((?:https?:(?:/{1,3}(www\.)?hastebin\.com)/)([a-z0-9]{10}))$", url)


def getHaste(hasteId):
Expand All @@ -58,7 +58,7 @@ def getDescription(lines):

def matchObs(url):
return re.match(
r"(?i)\b(?P<obsLogURL>(?P<obsLogURLRoot>https?:(?:/{1,3}(?:www\.)?obsproject\.com)/(analyzer|logs))/(?P<obsLogURLFilename>.{16}))", url)
r"(?i)^\b(?P<obsLogURL>(?P<obsLogURLRoot>https?:(?:/{1,3}(?:www\.)?obsproject\.com)/(analyzer|logs))/(?P<obsLogURLFilename>.{16}))$", url)


def getObslog(obsURL, obslogId):
Expand All @@ -75,7 +75,7 @@ def getLinesObslog(obslogText):

def matchPastebin(url):
return re.match(
r"(?i)\b((?:https?:(?:/{1,3}(www\.)?pastebin\.com/))(?:raw/)?(.{8}))", url)
r"(?i)^\b((?:https?:(?:/{1,3}(www\.)?pastebin\.com/))(?:raw/)?(.{8}))$", url)


def getRawPaste(obslogId):
Expand All @@ -93,7 +93,7 @@ def getLinesPaste(obslogText):

def matchDiscord(url):
return re.match(
r"(?i)\b((?:https?:(?:/{1,3}cdn\.discordapp\.com)/)(attachments/)([0-9]{18,}/[0-9]{18,}/(?:[0-9\-\_]{19}|message).txt(?:\?\S+\&)?))", url)
r"(?i)^\b((?:https?:(?:/{1,3}cdn\.discordapp\.com)/)(attachments/)([0-9]{18,}/[0-9]{18,}/(?:[0-9\-\_]{19}|message).txt(?:\?\S+\&)?))$", url)


def getRawDiscord(obslogId):
Expand Down