-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from rix1337/dev
Discord Notifications
- Loading branch information
Showing
9 changed files
with
79 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
# Quasarr | ||
# Project by https://github.com/rix1337 | ||
|
||
import json | ||
|
||
import requests | ||
|
||
|
||
def send_discord_captcha_alert(shared_state, title): | ||
if not shared_state.values.get("discord"): | ||
return False | ||
|
||
data = { | ||
'username': 'Quasarr', | ||
# 'avatar_url': 'https://imgur.com/fooBar.png', | ||
'embeds': [{ | ||
'title': title, | ||
'description': 'Links are protected. Please solve the CAPTCHA to continue downloading.', | ||
'fields': [ | ||
{ | ||
'name': '', | ||
'value': f'[Solve the CAPTCHA here!]({f"{shared_state.values['external_address']}/captcha"})', | ||
} | ||
|
||
] | ||
}] | ||
} | ||
|
||
response = requests.post(shared_state.values["discord"], data=json.dumps(data), | ||
headers={"Content-Type": "application/json"}) | ||
if response.status_code != 204: | ||
print(f"Failed to send message to Discord webhook. Status code: {response.status_code}") | ||
return False | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
|
||
def get_version(): | ||
return "0.1.0" | ||
return "0.1.1" | ||
|
||
|
||
def create_version_file(): | ||
|