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
# source: https://stackoverflow.com/a/57325050/10504918 | |
import requests | |
import logging | |
from http.client import HTTPConnection # py3 | |
log = logging.getLogger('urllib3') | |
log.setLevel(logging.DEBUG) | |
# logging from urllib3 to console |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Python bot for comment a list of urls in YouTube | |
import time | |
import numpy as np | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait |
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
# example bill | |
fn = '9251440300109733' | |
fd = '96304' | |
n = '1' | |
fp = '3341119416' | |
t = '02.08.2020+16%3A12' | |
s = '55.00' | |
# example | |
# https://github.com/enrike666/telegram-bot/blob/02c61ccd8622b9b954942b464b74020f6d254029/main_test.go |
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
# file: test_candels.csv | |
# | |
# 274.67 274.67 274.67 274.67 123460 2021-01-04 | |
# 274.67 274.67 274.67 274.67 123460 2021-01-05 | |
# file: requirements.txt | |
# | |
# backtrader==1.9.76.123 | |
# backtrader-plotting==1.1.0 |
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
# file: requirements.txt | |
# | |
# backtrader==1.9.76.123 | |
# backtrader-plotting==1.1.0 | |
# file: dt.csv | |
# | |
# date,close,high,low,open | |
# 2017-01-03T15:00:00,115.450,115.815,115.400,115.600 | |
# 2017-01-03T16:00:00,115.370,115.670,115.135,115.450 |
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
import base64 | |
data64 = 'AQAAAAAAAAAA9gS5bBWmAYqIWY0MWjEP4rYzOqSLqRblAr4CV4ylA4RUb5AegR/zDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJXH2dBhmCO+Qx2UVe6Jt+82VluOtYSKxdN49XuVOGTxQMfjEzKi8XVUfL4wQoTtWZmE7hxytvWvNfNpOPmRXJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==' | |
data_bytes = base64.b64decode(data64) | |
print(data_bytes) | |
print(len(data_bytes)) # 265 | |
from construct import Int8ub, Int64ub, Struct, Array, Byte, Bytes |
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
from typing import Union | |
alphabet = b'123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' | |
def b58encode_int(i: int, default_one: bool = True) -> bytes: | |
""" | |
Encode an integer using Base58 | |
""" | |
if not i and default_one: | |
return alphabet[0:1] |
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
import requests | |
message = 'Я люблю Яндекс Спич кит!' | |
message = message[:5000] | |
speed = 1.3 | |
voices = ['alyss', 'jane', 'oksana', 'omazh', 'zahar', 'ermil', 'alena', 'filipp'] | |
voice = voices[6] | |
emotions = ['good', 'evil', 'neutral'] | |
emotion = emotions[0] |
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
# requirements.txt | |
# vk-api==11.9.4 | |
# bs4 | |
# | |
import vk_api | |
from vk_api.audio import VkAudio | |
import requests | |
import shutil |
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
from telethon.tl.functions.messages import GetDialogsRequest | |
from telethon.tl.types import InputPeerEmpty | |
from telethon import TelegramClient | |
from telethon.tl.functions.messages import AddChatUserRequest | |
from telethon.tl.functions.messages import ForwardMessagesRequest | |
from telethon.tl.functions.messages import GetChatsRequest | |
from telethon.tl.functions.contacts import GetContactsRequest | |
from telethon.tl.functions.contacts import SearchRequest | |
from telethon.tl.functions.channels import InviteToChannelRequest | |
from telethon.tl.functions.channels import GetMessagesRequest |
OlderNewer