This file contains hidden or 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
async def suber(us_mission_count, cnt, count_channel, user_id, prize_num): | |
# проверяем количество подписок юзера если 0 выходим из функции | |
if us_mission_count != 0: | |
await asyncio.sleep(1) | |
print(cnt) | |
cursors = connect.execute(f'''SELECT url, chat_id FROM posts ''') | |
# проверяем заранее количество каналов для обязательной подписки | |
ch_count = 0 | |
check_user_subctibe = 0 # проверяем на сколько каналов подписан пользователь | |
for channel in cursors: |
This file contains hidden or 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
format = video_format_id_1 | |
link_mess = video_url_1 | |
print(link_mess) | |
chat_id = call.message.chat.id # автор сообщения | |
limit = 0 | |
# код для проверки лимита на скачивание у пользователя | |
cursor = connect.execute(f'''SELECT day_limit | |
FROM users | |
WHERE chat_id = {chat_id}''') |
This file contains hidden or 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
start_parse_type = input("Select the type of gun to start parsing.\n\n" | |
"1 - all weapon\n" | |
"2 - Custom weapon\n" | |
"Please enter: ") | |
type_list = ['machinegun', 'smg', 'pistol', 'rifle', 'shotgun'] | |
parse_list = [] | |
if int(start_parse_type) == 1: | |
for i in type_list: | |
print(i) |
This file contains hidden or 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
# war 1 | |
import socket | |
def scan_port(ip,port): | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.settimeout(0.5) | |
try: | |
connect = sock.connect((ip,port)) | |
print('Port :',port,' its open.') | |
sock.close() |
This file contains hidden or 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
import time | |
error = 0 | |
while True: | |
time.sleep(1) | |
try: | |
if error == 0: | |
i = input("input good or bad if ") |
This file contains hidden or 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
while True: | |
r = requests.get(url1, headers=HEADERS, params=PARAMS, proxies=PROXY[pr_count]) | |
print(r.status_code) | |
if r.status_code == 429: | |
pr_count += 1 | |
r = requests.get(url1, headers=HEADERS, params=PARAMS, proxies=PROXY[pr_count]) | |
print(r.status_code) | |
pr_count = 0 | |
if r.status_code == 429: | |
time.sleep(120) |
This file contains hidden or 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
import requests | |
url_change = 'https://openexchangerates.org/api/latest.json?app_id=565db73ce703480cb8d8849e32f32035' | |
r = requests.get(url_change) | |
r = r.json() | |
print(r["rates"]["CNY"]) |
This file contains hidden or 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
proxies = [] | |
for proxy in proxies: | |
response = requests.get(proxies=proxy) | |
if response.status_code == requests.codes['ok']: | |
break | |
response.text |
This file contains hidden or 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
import pyperclip | |
while True: | |
pyperclip.waitForNewPaste(666) | |
x = pyperclip.paste() | |
print(x) |
This file contains hidden or 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
from gtts import gTTS | |
import os | |
import subprocess | |
from subprocess import check_output | |
text = "Global warming is the long-term rise in the average temperature of the Earth’s climate system" | |
language = "en" | |
speech = gTTS(text=text, lang=language, slow=False) | |
speech.save("text.mp3") | |
os.system('nircmd mediaplay 10000 text.mp3') |
NewerOlder