├── pastebin-bot ├── __init__.py ├── images │ └── octocat.png ├── API.py ├── request.py ├── qr_generator.py ├── yt_download_shorts.py ├── insta_profile.py ├── link_shortner.py ├── quotes.py ├── insta_all_pictures.py ├── love_quotes.py └── bot.py ├── .DS_Store ├── .idea ├── vcs.xml ├── misc.xml ├── inspectionProfiles │ ├── profiles_settings.xml │ └── Project_Default.xml ├── modules.xml ├── Open_bot.iml ├── shelf │ ├── Uncommitted_changes_before_Checkout_at_26_08_22__1_56_AM__Changes_.xml │ ├── Uncommitted_changes_before_Checkout_at_24_08_22__10_49_PM__Changes_.xml │ ├── Uncommitted_changes_before_Checkout_at_25_08_22__11_06_PM__Changes_.xml │ ├── Uncommitted_changes_before_Checkout_at_26_08_22,_1_56_AM_[Changes] │ │ └── shelved.patch │ ├── Uncommitted_changes_before_Checkout_at_25_08_22,_11_06_PM_[Changes] │ │ └── shelved.patch │ └── Uncommitted_changes_before_Checkout_at_24_08_22,_10_49_PM_[Changes] │ │ └── shelved.patch └── workspace.xml ├── Dockerfile ├── .github └── workflows │ ├── greetings.yml │ └── linter.yml ├── guide ├── todo.txt └── firebase_README.md ├── reverse_requirement.txt ├── requriments.txt ├── .gitignore ├── .dockerignore ├── README.md ├── CODE_OF_CONDUCT.md ├── LICENSE └── CONTRIBUTING.md /pastebin-bot/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Sunglasses/VidLibreBot/HEAD/.DS_Store -------------------------------------------------------------------------------- /pastebin-bot/images/octocat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mr-Sunglasses/VidLibreBot/HEAD/pastebin-bot/images/octocat.png -------------------------------------------------------------------------------- /pastebin-bot/API.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | from dotenv import load_dotenv 4 | 5 | load_dotenv() 6 | 7 | API_KEY = os.getenv("TOKEN") 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9 2 | 3 | WORKDIR /code 4 | 5 | COPY ./requriments.txt /code/requriments.txt 6 | 7 | RUN pip install --no-cache-dir --upgrade -r /code/requriments.txt 8 | 9 | COPY ./pastebin-bot /code/pastebin-bot 10 | 11 | CMD ["python", "/code/pastebin-bot/bot.py"] 12 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pastebin-bot/request.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | 5 | def file_writer(text): 6 | 7 | with open("file.txt", "w") as text_file: 8 | text_file.write(text) 9 | 10 | 11 | def file_remover(): 12 | if os.path.exists("file.txt"): 13 | os.remove("file.txt") # one file at a time 14 | -------------------------------------------------------------------------------- /pastebin-bot/qr_generator.py: -------------------------------------------------------------------------------- 1 | # Import QRCode from pyqrcode 2 | import pyqrcode 3 | import png 4 | from pyqrcode import QRCode 5 | import os 6 | 7 | 8 | def generate_qr(link): 9 | url = pyqrcode.create(link) 10 | 11 | url.png("myqr.png", scale=6) 12 | 13 | 14 | def delete_qr(): 15 | if os.path.exists("myqr.png"): 16 | os.remove("myqr.png") 17 | -------------------------------------------------------------------------------- /.idea/Open_bot.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.github/workflows/greetings.yml: -------------------------------------------------------------------------------- 1 | name: Greetings 2 | 3 | on: [pull_request_target, issues] 4 | 5 | jobs: 6 | greeting: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/first-interaction@v1 10 | with: 11 | repo-token: ${{ secrets.GITHUB_TOKEN }} 12 | issue-message: 'Thank you 🙏🏻 for submitting your first issue to Open-Bot' 13 | pr-message: 'Thank you for 🙏🏻 contributing to Open-Bot' -------------------------------------------------------------------------------- /guide/todo.txt: -------------------------------------------------------------------------------- 1 | Paste.rs - 2 | 3 | - add an option to delete paste using their id 4 | 5 | - also add a logger to store all the paste generated 6 | 7 | 8 | Reels - 9 | 10 | - reels downloader 11 | 12 | 13 | Most Important - Dockerize the app....... 14 | 15 | Add a feature to view last posts of a public profile 16 | add feature to store session id to resist ip blocks 17 | 18 | add a 24/7 running on the linux server 19 | -------------------------------------------------------------------------------- /reverse_requirement.txt: -------------------------------------------------------------------------------- 1 | APScheduler==3.6.3 2 | cachetools==4.2.2 3 | certifi==2022.6.15 4 | charset-normalizer==2.1.1 5 | exif==1.3.5 6 | instaloader==4.9.2 7 | idna==3.3 8 | plum-py==0.8.1 9 | pyTelegramBotAPI==4.7.0 10 | python-dotenv==0.20.0 11 | python-telegram-bot==13.13 12 | pytz==2022.2.1 13 | pytz-deprecation-shim==0.1.0.post0 14 | requests==2.28.1 15 | six==1.16.0 16 | tornado==6.2 17 | tzdata==2022.2 18 | tzlocal==4.2 19 | urllib3==1.26.12 20 | PyQRCode==1.2.1 21 | -------------------------------------------------------------------------------- /.idea/shelf/Uncommitted_changes_before_Checkout_at_26_08_22__1_56_AM__Changes_.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.idea/shelf/Uncommitted_changes_before_Checkout_at_24_08_22__10_49_PM__Changes_.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.idea/shelf/Uncommitted_changes_before_Checkout_at_25_08_22__11_06_PM__Changes_.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pastebin-bot/yt_download_shorts.py: -------------------------------------------------------------------------------- 1 | from pytube import YouTube 2 | import ssl 3 | 4 | ssl._create_default_https_context = ssl._create_unverified_context 5 | 6 | 7 | def download_video(link_of_video): 8 | url = link_of_video 9 | 10 | myvideo = YouTube(url) 11 | 12 | download = myvideo.streams.get_highest_resolution() 13 | 14 | download.download(filename="output.mp4") 15 | 16 | 17 | def get_title(link_of_video): 18 | url = link_of_video 19 | 20 | myvideo = YouTube(url) 21 | 22 | return myvideo.title 23 | -------------------------------------------------------------------------------- /pastebin-bot/insta_profile.py: -------------------------------------------------------------------------------- 1 | import instaloader 2 | import os 3 | import shutil 4 | from dotenv import load_dotenv 5 | 6 | load_dotenv() 7 | 8 | 9 | def profile_downloader(username): 10 | name = os.getenv("username") 11 | passw = os.getenv("password") 12 | ig = instaloader.Instaloader() 13 | ig.login(name, passw) 14 | ig.download_profile(username, profile_pic_only=True) 15 | 16 | 17 | # dp = input("Enter Insta username : ") 18 | def get_all_images(username): 19 | name = os.getenv("username") 20 | passw = os.getenv("password") 21 | ig = instaloader.Instaloader() 22 | ig.login(name, passw) 23 | 24 | 25 | def profile_delete(username): 26 | shutil.rmtree(f"{username}") 27 | -------------------------------------------------------------------------------- /pastebin-bot/link_shortner.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from urllib.parse import quote 3 | 4 | 5 | def short(url: str): 6 | url = "https://url-shortener-service.p.rapidapi.com/shorten" 7 | payload_url = url 8 | 9 | payload = f"url={quote(payload_url)}" 10 | headers = { 11 | "content-type": "application/x-www-form-urlencoded", 12 | "X-RapidAPI-Key": "e02923797dmshddea57448263f98p13ab17jsn9e252949aa6f", 13 | "X-RapidAPI-Host": "url-shortener-service.p.rapidapi.com", 14 | } 15 | response = requests.request("POST", url, data=payload, headers=headers) 16 | x = dict(response.json()) 17 | return_link = "" 18 | for i in x.values(): 19 | return_link = i 20 | return return_link 21 | -------------------------------------------------------------------------------- /pastebin-bot/quotes.py: -------------------------------------------------------------------------------- 1 | import random 2 | import threading 3 | 4 | import requests 5 | from random import randint 6 | 7 | api = "https://api.api-ninjas.com/v1/quotes?category=" 8 | quotes = [] 9 | quote_number = 0 10 | 11 | 12 | def preload_quotes(): 13 | global quotes 14 | quotes.clear() 15 | 16 | randon_quote = requests.get( 17 | api, headers={"X-Api-Key": "ZSVhux9848gfWCCCLMlESQ==UwDZ4yCxgj0irhQu"} 18 | ).json() 19 | content = randon_quote[0] 20 | author = content["author"] 21 | quote = content["quote"] + "\n\n" + "By " + author 22 | quotes.append(quote) 23 | 24 | 25 | # print(quotes[0]) 26 | 27 | # preload_quotes() 28 | # 29 | # def random_quote(): 30 | # 31 | # global quotes 32 | # global quote_number 33 | # 34 | # return quotes[randint(1,19)] 35 | # 36 | # quote_number = quote_number + 1 37 | # 38 | # if quotes[quote_number] == quotes[-3]: 39 | # thread = threading.Thread(target=preload_quotes) 40 | # thread.start() 41 | -------------------------------------------------------------------------------- /.github/workflows/linter.yml: -------------------------------------------------------------------------------- 1 | name: black-action 2 | on: [push, pull_request] 3 | jobs: 4 | linter_name: 5 | name: runner / black 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | - name: Check files using the black formatter 10 | uses: rickstaa/action-black@v1 11 | id: action_black 12 | with: 13 | black_args: "." 14 | - name: Create Pull Request 15 | if: steps.action_black.outputs.is_formatted == 'true' 16 | uses: peter-evans/create-pull-request@v3 17 | with: 18 | token: ${{ secrets.GITHUB_TOKEN }} 19 | title: "Format Python code with psf/black push" 20 | commit-message: ":art: Python code fromated with psf/black" 21 | body: | 22 | There appear to be some python formatting errors in ${{ github.sha }}. This pull request 23 | uses the [psf/black](https://github.com/psf/black) formatter to fix these issues. 24 | base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch 25 | branch: actions/black 26 | -------------------------------------------------------------------------------- /pastebin-bot/insta_all_pictures.py: -------------------------------------------------------------------------------- 1 | from instaloader import Instaloader, Profile 2 | import threading 3 | import shutil 4 | import os 5 | from dotenv import load_dotenv 6 | 7 | load_dotenv() 8 | 9 | 10 | profile_instance = Instaloader() 11 | 12 | 13 | def login(profile): 14 | name = os.getenv("username") 15 | passw = os.getenv("password") 16 | profile.login(name, passw) 17 | 18 | 19 | def fetch_posts(user): 20 | 21 | login(profile_instance) 22 | 23 | try: 24 | prof = Profile.from_username(profile_instance.context, user) 25 | print(prof) 26 | posts = prof.get_posts() 27 | except: 28 | raise FileNotFoundError 29 | 30 | for post in posts: 31 | try: 32 | task = threading.Thread( 33 | target=profile_instance.download_post, 34 | args=( 35 | post, 36 | user, 37 | ), 38 | ) 39 | task.start() 40 | except: 41 | print("Skipping due to status code 401") 42 | 43 | 44 | def profile_delete(username): 45 | shutil.rmtree(f"{username}") 46 | -------------------------------------------------------------------------------- /guide/firebase_README.md: -------------------------------------------------------------------------------- 1 | # Solutions 2 | > If you are facing issues with database read and write then go to your firebase project then realtime database then Rules then change the values of '.read' and '.write' to true and click on publish (ignore the warnings)
3 | 4 | # Requirements 5 | > pyrebase module for python - pip install pyrebase
6 | > create a project in firebase
7 | > enable authentication with email and passowrd
8 | > create firebase realtime data base
9 | > goto Project settings - General - click on Add app
10 | > choose web app
11 | > On Register app git it a name than click on register app
12 | > then copy the fireabseConfig and past it inside firebase.py in the way of python dictionary as shown there in the firebase.py module
13 | > check if it contains key value pair of database url if it doesnt than add "databaseURL": " your database link here "
14 | > - to get fatabase link go to realtime database than click on 🔗 icon
15 | > then again go to project settings - Service accounts - click on Generate new private key
16 | > then copy the file content into 'serviceAccountKey.json'
17 | > now you are good to go! 👍🏿
18 | -------------------------------------------------------------------------------- /requriments.txt: -------------------------------------------------------------------------------- 1 | absl-py==1.2.0 2 | APScheduler==3.6.3 3 | astunparse==1.6.3 4 | beautifulsoup4==4.11.1 5 | cachetools==4.2.2 6 | certifi==2022.6.15 7 | charset-normalizer==2.1.1 8 | configparser==5.2.0 9 | exif==1.3.5 10 | flatbuffers==1.12 11 | gast==0.4.0 12 | google-auth==2.9.1 13 | google-auth-oauthlib==0.4.6 14 | google-pasta==0.2.0 15 | grpcio==1.47.0 16 | h5py==3.7.0 17 | httplib2==0.20.4 18 | idna==3.3 19 | importlib-metadata==4.12.0 20 | insta-scrape==2.1.2 21 | install==1.3.5 22 | instaloader==4.9.2 23 | keras==2.9.0 24 | Keras-Preprocessing==1.1.2 25 | libclang==14.0.1 26 | mac==1.0.8 27 | Markdown==3.4.1 28 | MarkupSafe==2.1.1 29 | numpy==1.23.1 30 | oauthlib==3.2.0 31 | opencv-python==4.6.0.66 32 | opt-einsum==3.3.0 33 | packaging==21.3 34 | pafy==0.5.5 35 | pexpect==4.8.0 36 | Pillow==9.2.0 37 | plum-py==0.8.1 38 | prettytable==3.3.0 39 | progressbar==2.5 40 | protobuf==3.19.4 41 | ptyprocess==0.7.0 42 | pyasn1==0.4.8 43 | pyasn1-modules==0.2.8 44 | pyparsing==3.0.9 45 | pypng==0.20220715.0 46 | PyQRCode==1.2.1 47 | pyTelegramBotAPI==4.7.0 48 | python-dotenv==0.20.0 49 | python-telegram-bot==13.13 50 | pytube==12.1.0 51 | pytz==2022.2.1 52 | pytz-deprecation-shim==0.1.0.post0 53 | PyYAML==6.0 54 | requests==2.28.1 55 | requests-oauthlib==1.3.1 56 | rfc3987==1.3.8 57 | rsa==4.9 58 | six==1.16.0 59 | soupsieve==2.3.2.post1 60 | telebot==0.0.4 61 | tensorboard==2.9.1 62 | tensorboard-data-server==0.6.1 63 | tensorboard-plugin-wit==1.8.1 64 | tensorflow==2.9.1 65 | tensorflow-estimator==2.9.0 66 | tensorflow-io-gcs-filesystem==0.26.0 67 | termcolor==1.1.0 68 | tornado==6.2 69 | typing_extensions==4.3.0 70 | tzdata==2022.2 71 | tzlocal==4.2 72 | urllib3==1.26.12 73 | wcwidth==0.2.5 74 | Werkzeug==2.2.0 75 | wrapt==1.14.1 76 | youtube-dl==2021.12.17 77 | zipp==3.8.1 78 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | bot-env/ 113 | 114 | # Spyder project settings 115 | .spyderproject 116 | .spyproject 117 | 118 | # Rope project settings 119 | .ropeproject 120 | 121 | # mkdocs documentation 122 | /site 123 | 124 | # mypy 125 | .mypy_cache/ 126 | .dmypy.json 127 | dmypy.json 128 | 129 | # Pyre type checker 130 | .pyre/ 131 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | ### Python template 2 | # Byte-compiled / optimized / DLL files 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | cover/ 54 | 55 | # Translations 56 | *.mo 57 | *.pot 58 | 59 | # Django stuff: 60 | *.log 61 | local_settings.py 62 | db.sqlite3 63 | db.sqlite3-journal 64 | 65 | # Flask stuff: 66 | instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | .pybuilder/ 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | # pyenv 87 | # For a library or package, you might want to ignore these files since the code is 88 | # intended to run in multiple environments; otherwise, check them in: 89 | # .python-version 90 | 91 | # pipenv 92 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 93 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 94 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 95 | # install all needed dependencies. 96 | #Pipfile.lock 97 | 98 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 99 | __pypackages__/ 100 | 101 | # Celery stuff 102 | celerybeat-schedule 103 | celerybeat.pid 104 | 105 | # SageMath parsed files 106 | *.sage.py 107 | 108 | # Environments 109 | .env 110 | .venv 111 | env/ 112 | venv/ 113 | ENV/ 114 | env.bak/ 115 | venv.bak/ 116 | 117 | # Spyder project settings 118 | .spyderproject 119 | .spyproject 120 | 121 | # Rope project settings 122 | .ropeproject 123 | 124 | # mkdocs documentation 125 | /site 126 | 127 | # mypy 128 | .mypy_cache/ 129 | .dmypy.json 130 | dmypy.json 131 | 132 | # Pyre type checker 133 | .pyre/ 134 | 135 | # pytype static type analyzer 136 | .pytype/ 137 | 138 | # Cython debug symbols 139 | cython_debug/ 140 | 141 | -------------------------------------------------------------------------------- /pastebin-bot/love_quotes.py: -------------------------------------------------------------------------------- 1 | happy_love_quotes = [ 2 | """ "For small creatures such as we, the vastness is bearable only through love." – Carl Sagan """, 3 | """ "When you're a kid, you assume your parents are soulmates. My kids are gonna be right about that." – The Office """, 4 | """ "So excuse me forgetting 5 | But these things, I do 6 | You see, I've forgotten 7 | If they're green or they're blue. 8 | Anyway, the thing is, what I really mean 9 | Yours are the sweetest eyes I've ever seen." 10 | – Elton John, "Your Song" """, 11 | """ "Nobody has ever measured, not even poets, how much the heart can hold." 12 | – Zelda Fitzgerald """, 13 | """ "Two people in love, alone, isolated from the world, that's beautiful." – Milan Kundera 14 | """, 15 | """ "True love stories never have endings." – Richard Bach """, 16 | """ "The best and most beautiful things in the world cannot be seen or even touched—they must be felt with the heart." – Helen Keller """, 17 | """ "Deep within us — no matter who we are — there lives a feeling of wanting to be lovable, of wanting to be the kind of person that others like to be with. And the greatest thing we can do is to let people know that they are loved and capable of loving." – Fred Rogers """, 18 | """ "The greatest thing you'll ever learn is just to love and be loved in return." – Nat King Cole, "Nature Boy" lyrics """, 19 | """ "Laughter is holier than piety, freedom is sweeter than fame, and in the end it's love and love alone that really matters." – Tom Robbins """, 20 | """ "You know you're in love when you can't fall asleep because reality is finally better than your dreams." – Dr. Seuss """, 21 | """ She had blue skin, 22 | And so did he. 23 | He kept it hid 24 | And so did she. 25 | They searched for blue 26 | Their whole life through, 27 | Then passed right by- 28 | And never knew." 29 | – Shel Silverstein, "Masks" """, 30 | """ "You're my one in five billion." – The X-Files """, 31 | """ "Happiness is anyone and anything at all that's loved by you." – You're a Good Man, Charlie Brown """, 32 | """ "A friend is someone who knows all about you and still loves you." – Elbert Hubbard""", 33 | """ "Maybe you don't need the whole world to love you, you know. Maybe you just need one person." – The Muppets """, 34 | """ "That's why they call them crushes. If they were easy, they'd call them something else." – Sixteen Candles """, 35 | """ "Once upon a time there was a boy who loved a girl, and her laughter was a question he wanted to spend his whole life answering." – Nicole Krauss, The History of Love """, 36 | """ "Love is an irresistible desire to be irresistibly desired." – Robert Frost """, 37 | """ "At the touch of love everyone becomes a poet." – Plato """, 38 | """ "Love is the condition in which the happiness of another person is essential to your own." – Robert A. Heinlein, Stranger in a Strange Land """, 39 | """ "But the heart's not like a box that gets filled up. It expands in size the more you love." – Her """, 40 | """ "There is no remedy for love, but to love more." – Thoreau """, 41 | ] 42 | 43 | sad_love_quotes = [ 44 | """ 45 | Duniya mai ab ishq baaki nahi hai, 46 | Bus ek shakhs inke liye kaafi nahi hai. 47 | """, 48 | """ 49 | Tum khud hi khud ko satate ho, 50 | Dil kyu itni jaldi kisi se lagate ho. 51 | """, 52 | """ 53 | Sath hokar Phir bhi fikar karte hai, 54 | Ab har kahi hum unka zikar karte hai. 55 | """, 56 | """ 57 | Kitno ne tujhse sawal kia hai, 58 | Kya Kisi ne tera khayal bhi kiya hai? 59 | """, 60 | ] 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pastebin-Telegram 📺 2 | 3 | Open-Bot for Telegram 4 | 5 | 6 | [![GitHub issues](https://img.shields.io/github/issues/Mr-Sunglasses/pastebin-telegram)](https://github.com/Mr-Sunglasses/pastebin-telegram/issues) 7 | [![GitHub forks](https://img.shields.io/github/forks/Mr-Sunglasses/pastebin-telegram)](https://github.com/Mr-Sunglasses/pastebin-telegram/network) 8 | [![GitHub stars](https://img.shields.io/github/stars/Mr-Sunglasses/pastebin-telegram)](https://github.com/Mr-Sunglasses/pastebin-telegram/stargazers) 9 | [![GitHub license](https://img.shields.io/github/license/Mr-Sunglasses/pastebin-telegram)](https://github.com/Mr-Sunglasses/pastebin-telegram/blob/main/LICENSE) 10 | [![Open Source Love svg1](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) ![contributions welcome](https://img.shields.io/static/v1.svg?label=Contributions&message=Welcome&color=0059b3&style=flat-square) ![GitHub contributors](https://img.shields.io/github/contributors-anon/Mr-Sunglasses/pastebin-telegram) 11 |
12 | 13 | 14 | 15 | 16 | 17 | ### BROWSER USAGE 18 | 19 | https://paste.rs/web 20 | 21 | ### API USAGE 22 | `POST https://paste.rs/` 23 | 24 | Send the raw data along. Will respond with a link to the paste. 25 | 26 | - **Response code 201 (Created):** 27 | The entire paste was uploaded. 28 | - **Response code 206 (Partial):** 29 | The paste exceeded the maximum upload size, only part of the paste was uploaded. 30 | - **Other response codes:** 31 | An error occurred. 32 | 33 | Pasting is heavily rate limited. 34 | 35 | --- 36 | `GET https://paste.rs/` 37 | 38 | Retrieve the paste with the given id as plain-text. 39 | 40 | --- 41 | 42 | `GET https://paste.rs/.` 43 | 44 | Retrieve the paste with the given id. If ext is a known code file extension, the paste is syntax highlighted and returned as HTML. If ext is a known file extension, the paste is returned with the extension's corresponding Content-Type. Otherwise, the paste is returned as plain text. 45 | 46 | --- 47 | 48 | `DELETE https://paste.rs/` 49 | 50 | Delete the paste with the given id. 51 | 52 | ### Examples 53 | 54 | - **Paste a file named 'file.txt' using PowerShell:** 55 | 56 | `Invoke-RestMethod -Uri "https://paste.rs" -Method Post -InFile .\file.txt` 57 | 58 | - **Paste from stdin using PowerShell:** 59 | 60 | `echo "Hi!" | Invoke-RestMethod -Uri "https://paste.rs" -Method Post` 61 | 62 | - **Delete an existing paste with id using PowerShell:** 63 | 64 | `Invoke-RestMethod -Uri "https://paste.rs/" -Method Delete` 65 | 66 | - **A PowerShell function that can be used for quick pasting from the command line. The command takes a filename or reads from stdin if none was supplied and outputs the URL of the paste to stdout: 'Paste file.txt' or 'echo hi" | Paste'.** 67 | 68 | ``` 69 | function Paste([string]$file) { 70 | $Data = if ($file) {Get-Content $file} else {$input} 71 | Invoke-RestMethod -Uri "https://paste.rs" -Method Post -Body $Data 72 | } 73 | ``` 74 | 75 | Run Through Docker 76 | 77 | docker build -t container_name . 78 | 79 | docker run -e TOKEN=TELEGRAM_BOT_TOKEN -e username=INTA_USER-NAME -e password=INSTA_PASSWORD container_name:latest 80 | 81 | ## 💪 Thanks to all Wonderful Contributors 82 | 83 | Thanks a lot for spending your time helping Pastebin-Telegram grow. 84 | Thanks a lot! Keep rocking 🍻 85 | 86 | [![Contributors](https://contrib.rocks/image?repo=Mr-Sunglasses/pastebin-telegram)](https://github.com/Mr-Sunglasses/pastebin-telegram/graphs/contributors) 87 | 88 | ## 🙏 Support++ 89 | 90 | This project needs your shiny star ⭐. 91 | Don't forget to leave a star ⭐️ 92 | 93 | [![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/) [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) 94 | 95 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct - Pastebin-telegram 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to make participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to a positive environment for our 15 | community include: 16 | 17 | * Demonstrating empathy and kindness toward other people 18 | * Being respectful of differing opinions, viewpoints, and experiences 19 | * Giving and gracefully accepting constructive feedback 20 | * Accepting responsibility and apologizing to those affected by our mistakes, 21 | and learning from the experience 22 | * Focusing on what is best not just for us as individuals, but for the 23 | overall community 24 | 25 | Examples of unacceptable behavior include: 26 | 27 | * The use of sexualized language or imagery, and sexual attention or 28 | advances 29 | * Trolling, insulting or derogatory comments, and personal or political attacks 30 | * Public or private harassment 31 | * Publishing others' private information, such as a physical or email 32 | address, without their explicit permission 33 | * Other conduct which could reasonably be considered inappropriate in a 34 | professional setting 35 | 36 | ## Our Responsibilities 37 | 38 | Project maintainers are responsible for clarifying and enforcing our standards of 39 | acceptable behavior and will take appropriate and fair corrective action in 40 | response to any behavior that they deem inappropriate, 41 | threatening, offensive, or harmful. 42 | 43 | Project maintainers have the right and responsibility to remove, edit, or reject 44 | comments, commits, code, wiki edits, issues, and other contributions that are 45 | not aligned to this Code of Conduct, and will 46 | communicate reasons for moderation decisions when appropriate. 47 | 48 | ## Scope 49 | 50 | This Code of Conduct applies within all community spaces, and also applies when 51 | an individual is officially representing the community in public spaces. 52 | Examples of representing our community include using an official e-mail address, 53 | posting via an official social media account, or acting as an appointed 54 | representative at an online or offline event. 55 | 56 | ## Enforcement 57 | 58 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 59 | reported to the community leaders responsible for enforcement at . 60 | All complaints will be reviewed and investigated promptly and fairly. 61 | 62 | All community leaders are obligated to respect the privacy and security of the 63 | reporter of any incident. 64 | 65 | ## Enforcement Guidelines 66 | 67 | Community leaders will follow these Community Impact Guidelines in determining 68 | the consequences for any action they deem in violation of this Code of Conduct: 69 | 70 | ### 1. Correction 71 | 72 | **Community Impact**: Use of inappropriate language or other behavior deemed 73 | unprofessional or unwelcome in the community. 74 | 75 | **Consequence**: A private, written warning from community leaders, providing 76 | clarity around the nature of the violation and an explanation of why the 77 | behavior was inappropriate. A public apology may be requested. 78 | 79 | ### 2. Warning 80 | 81 | **Community Impact**: A violation through a single incident or series 82 | of actions. 83 | 84 | **Consequence**: A warning with consequences for continued behavior. No 85 | interaction with the people involved, including unsolicited interaction with 86 | those enforcing the Code of Conduct, for a specified period of time. This 87 | includes avoiding interactions in community spaces as well as external channels 88 | like social media. Violating these terms may lead to a temporary or 89 | permanent ban. 90 | 91 | ### 3. Temporary Ban 92 | 93 | **Community Impact**: A serious violation of community standards, including 94 | sustained inappropriate behavior. 95 | 96 | **Consequence**: A temporary ban from any sort of interaction or public 97 | communication with the community for a specified period of time. No public or 98 | private interaction with the people involved, including unsolicited interaction 99 | with those enforcing the Code of Conduct, is allowed during this period. 100 | Violating these terms may lead to a permanent ban. 101 | 102 | ### 4. Permanent Ban 103 | 104 | **Community Impact**: Demonstrating a pattern of violation of community 105 | standards, including sustained inappropriate behavior, harassment of an 106 | individual, or aggression toward or disparagement of classes of individuals. 107 | 108 | **Consequence**: A permanent ban from any sort of public interaction within 109 | the community. 110 | 111 | ## Attribution 112 | 113 | This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version 114 | [1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and 115 | [2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md), 116 | and was generated by [contributing-gen](https://github.com/bttger/contributing-gen). 117 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /pastebin-bot/bot.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from API import API_KEY 4 | import telebot 5 | import os, subprocess, threading 6 | from request import file_writer, file_remover 7 | from insta_profile import profile_downloader, profile_delete 8 | from insta_all_pictures import fetch_posts, profile_delete 9 | from qr_generator import generate_qr, delete_qr 10 | from quotes import preload_quotes, quotes 11 | from random import randint 12 | from love_quotes import happy_love_quotes, sad_love_quotes 13 | from yt_download_shorts import download_video, get_title 14 | import instaloader 15 | from link_shortner import short 16 | 17 | bot = telebot.TeleBot(API_KEY) 18 | 19 | # TBD 20 | # def handle_message(update, context): 21 | # user_first_name = update.message.chat.first_name 22 | # user_last_name = update.message.chat.last_name 23 | # username = update.message.chat.username 24 | # update.message.reply_text( 25 | # f"Hey👋 {user_first_name} {user_last_name} aka @{username} welcome to the Open-Bot type: /help to explore options." 26 | # ) 27 | # 28 | # 29 | 30 | 31 | # This Decorator handle's the message with and /start 32 | @bot.message_handler(commands=["start"]) 33 | def handle_start(message): 34 | bot.reply_to( 35 | message, 36 | "Welcome to Open-Bot Powered by Open-Source and Developed by @thisiskanishkP", 37 | ) 38 | bot.send_photo(chat_id=message.chat.id, photo=open("images/octocat.png", "rb")) 39 | 40 | 41 | # This Decorator helps in handling the message with /help 42 | @bot.message_handler(commands=["help"]) 43 | def handle_help(message): 44 | bot.reply_to( 45 | message, 46 | """\ 47 | The Following Commands can we user 48 | 49 | /start - to say welcome message 50 | /help - to get help 51 | /paste - to push content to paste.rs 52 | /pic - to download a profile pic of the user 53 | /post - to download all pictures posted by the user 54 | /qr - to generate qr code 55 | /quote - for getting random quotes 56 | /love_quote_happy - for romantic quotes [happy] 57 | /love_quote_sad - for romantic quotes [sad] 58 | /yt_dl - to download a youtube video.......[it may take sometime to download a youtube video so chill] 59 | /short - To shorten the link\ 60 | """, 61 | ) 62 | 63 | 64 | # This Decorator helps in handling the message with /paste 65 | @bot.message_handler(commands=["paste"]) 66 | def handle_paste(message): 67 | chat_id = message.chat.id 68 | data = message.text 69 | send_data = data[7::] 70 | file_writer(text=send_data) 71 | output = subprocess.check_output( 72 | "curl --data-binary @file.txt https://paste.rs/", shell=True 73 | ) 74 | bot.send_message(chat_id, f"{output.decode('utf-8')}") 75 | file_remover() 76 | 77 | 78 | # This Decorator helps in handling the message with /pic 79 | @bot.message_handler(commands=["pic"]) 80 | def handle_pic(message): 81 | chat_id = message.chat.id 82 | data = message.text 83 | username = data[5::] 84 | print(username) 85 | try: 86 | profile_downloader(username=username) 87 | bot.reply_to( 88 | message, 89 | f"Please wait while we are sending you the profile pic of {username} \n Don't worry it will take a minute or so 🤝", 90 | ) 91 | for root, subdirs, files in os.walk(username): 92 | for file in files: 93 | if os.path.splitext(file)[1].lower() in (".jpg", ".jpeg"): 94 | bot.send_photo( 95 | chat_id, photo=open(f"{os.path.join(root, file)}", "rb") 96 | ) 97 | profile_delete(username=username) 98 | except: 99 | bot.reply_to(message, f"{username} is not found") 100 | 101 | 102 | # This Decorator helps in handling the message with /post 103 | @bot.message_handler(commands=["post"]) 104 | def handle_insta(message): 105 | chat_id = message.chat.id 106 | data = message.text 107 | username = data[6::] 108 | try: 109 | task = threading.Thread(target=fetch_posts, args=(username,)) 110 | task.start() 111 | bot.reply_to( 112 | message, f"Getting posts of {username} for you. \nPlease wait for a moment." 113 | ) 114 | task.join() 115 | for root, subdirs, files in os.walk(username, topdown=False): 116 | for file in files: 117 | if os.path.splitext(file)[1].lower() in (".jpg", ".jpeg"): 118 | bot.send_photo( 119 | chat_id, photo=open(f"{os.path.join(root, file)}", "rb") 120 | ) 121 | 122 | profile_delete(username=username) 123 | 124 | except FileNotFoundError: 125 | bot.reply_to(message, f"{username} is not found") 126 | 127 | 128 | # This Decorator helps in handling the message with /qr 129 | @bot.message_handler(commands=["qr"]) 130 | def handle_qr(message): 131 | chat_id = message.chat.id 132 | text = message.text 133 | link = text[4::] 134 | try: 135 | generate_qr(link=link) 136 | bot.send_photo(chat_id=chat_id, photo=open("myqr.png", "rb")) 137 | delete_qr() 138 | except: 139 | bot.reply_to(message, f"QR of this {link} can't be generated") 140 | delete_qr() 141 | 142 | 143 | # This Decorator helps in handling the message with /quote 144 | @bot.message_handler(commands=["quote"]) 145 | def handle_quote(message): 146 | chat_id = message.chat.id 147 | preload_quotes() 148 | bot.reply_to(message, f"{quotes[0]}") 149 | 150 | 151 | # This Decorator helps in handling the message with /love_quote_happy 152 | @bot.message_handler(commands=["love_quote_happy"]) 153 | def handle_love_quote_happy(message): 154 | bot.reply_to(message, f"❤️ {happy_love_quotes[randint(0, 22)]}") 155 | 156 | 157 | # This Decorator helps in handling the message with /love_quote_sad 158 | @bot.message_handler(commands=["love_quote_sad"]) 159 | def handle_love_quote_sad(message): 160 | bot.reply_to(message, f"❤️ {sad_love_quotes[randint(0, 22)]}") 161 | 162 | 163 | # This Decorator helps in handling the message with /yt_dl 164 | @bot.message_handler(commands=["yt_dl"]) 165 | def handle_video_download_yt(message): 166 | chat_id = message.chat.id 167 | data = message.text 168 | link_video = data[7::] 169 | try: 170 | bot.send_message( 171 | chat_id, 172 | "Please wait while the Video is Downloading, It may take 3-5 minutes to download a 20 mb video 🙏", 173 | ) 174 | download_video(link_video) 175 | bot.send_video(chat_id, video=open("output.mp4", "rb"), supports_streaming=True) 176 | time.sleep( 177 | 50 178 | ) # Alternate way, the problem occurs when file deletion, Better way to use Async await for this task 179 | if os.path.exists("output.mp4"): 180 | os.remove("output.mp4") 181 | except instaloader.ProfileNotExistsException: 182 | bot.reply_to(message, f"{link_video} is not Found") 183 | except instaloader.ConnectionException: 184 | bot.reply_to(message, "IP is Blocked Please Try After Some Time") 185 | 186 | 187 | # This Decorator Deals with /short 188 | @bot.message_handler(commands=["short"]) 189 | def handle_short(message): 190 | chat_id = message.chat.id 191 | data = message.text 192 | payload_link_data = data[7::] 193 | try: 194 | bot.reply_to(message, f"{short(payload_link_data)}") 195 | except: 196 | bot.reply_to(message, f"We can't abel to short{payload_link_data}") 197 | 198 | 199 | if __name__ == "__main__": 200 | bot.infinity_polling() 201 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing to Pastebin-telegram 3 | 4 | First off, thanks for taking the time to contribute! ❤️ 5 | 6 | All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 7 | 8 | > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: 9 | > - Star the project 10 | > - Tweet about it 11 | > - Refer this project in your project's readme 12 | > - Mention the project at local meetups and tell your friends/colleagues 13 | 14 | 15 | ## Table of Contents 16 | 17 | - [Code of Conduct](#code-of-conduct) 18 | - [I Have a Question](#i-have-a-question) 19 | - [I Want To Contribute](#i-want-to-contribute) 20 | - [Reporting Bugs](#reporting-bugs) 21 | - [Suggesting Enhancements](#suggesting-enhancements) 22 | - [Your First Code Contribution](#your-first-code-contribution) 23 | - [Improving The Documentation](#improving-the-documentation) 24 | - [Styleguides](#styleguides) 25 | - [Commit Messages](#commit-messages) 26 | - [Join The Project Team](#join-the-project-team) 27 | 28 | 29 | ## Code of Conduct 30 | 31 | This project and everyone participating in it is governed by the 32 | [Pastebin-telegram Code of Conduct](https://github.com/Mr-Sunglasses/pastebin-telegramblob/master/CODE_OF_CONDUCT.md). 33 | By participating, you are expected to uphold this code. Please report unacceptable behavior 34 | to . 35 | 36 | 37 | ## I Have a Question 38 | 39 | > If you want to ask a question, we assume that you have read the available [Documentation](). 40 | 41 | Before you ask a question, it is best to search for existing [Issues](https://github.com/Mr-Sunglasses/pastebin-telegram/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. 42 | 43 | If you then still feel the need to ask a question and need clarification, we recommend the following: 44 | 45 | - Open an [Issue](https://github.com/Mr-Sunglasses/pastebin-telegram/issues/new). 46 | - Provide as much context as you can about what you're running into. 47 | - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. 48 | 49 | We will then take care of the issue as soon as possible. 50 | 51 | 65 | 66 | ## I Want To Contribute 67 | 68 | > ### Legal Notice 69 | > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. 70 | 71 | ### Reporting Bugs 72 | 73 | 74 | #### Before Submitting a Bug Report 75 | 76 | A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. 77 | 78 | - Make sure that you are using the latest version. 79 | - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](). If you are looking for support, you might want to check [this section](#i-have-a-question)). 80 | - To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/Mr-Sunglasses/pastebin-telegramissues?q=label%3Abug). 81 | - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. 82 | - Collect information about the bug: 83 | - Stack trace (Traceback) 84 | - OS, Platform and Version (Windows, Linux, macOS, x86, ARM) 85 | - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. 86 | - Possibly your input and the output 87 | - Can you reliably reproduce the issue? And can you also reproduce it with older versions? 88 | 89 | 90 | #### How Do I Submit a Good Bug Report? 91 | 92 | > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . 93 | 94 | 95 | We use GitHub issues to track bugs and errors. If you run into an issue with the project: 96 | 97 | - Open an [Issue](https://github.com/Mr-Sunglasses/pastebin-telegram/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) 98 | - Explain the behavior you would expect and the actual behavior. 99 | - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. 100 | - Provide the information you collected in the previous section. 101 | 102 | Once it's filed: 103 | 104 | - The project team will label the issue accordingly. 105 | - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. 106 | - If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution). 107 | 108 | 109 | 110 | 111 | ### Suggesting Enhancements 112 | 113 | This section guides you through submitting an enhancement suggestion for Pastebin-telegram, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. 114 | 115 | 116 | #### Before Submitting an Enhancement 117 | 118 | - Make sure that you are using the latest version. 119 | - Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration. 120 | - Perform a [search](https://github.com/Mr-Sunglasses/pastebin-telegram/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. 121 | - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. 122 | 123 | 124 | #### How Do I Submit a Good Enhancement Suggestion? 125 | 126 | Enhancement suggestions are tracked as [GitHub issues](https://github.com/Mr-Sunglasses/pastebin-telegram/issues). 127 | 128 | - Use a **clear and descriptive title** for the issue to identify the suggestion. 129 | - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. 130 | - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. 131 | - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. 132 | - **Explain why this enhancement would be useful** to most Pastebin-telegram users. You may also want to point out the other projects that solved it better and which could serve as inspiration. 133 | 134 | 135 | 136 | ### Your First Code Contribution 137 | 141 | 142 | ### Improving The Documentation 143 | 147 | 148 | ## Styleguides 149 | ### Commit Messages 150 | 153 | 154 | ## Join The Project Team 155 | 156 | 157 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 21 | 22 | 23 | 28 | 30 | 31 | 33 | 34 | 36 | 37 | 38 | 39 | 42 | { 43 | "keyToString": { 44 | "RunOnceActivity.OpenProjectViewOnStart": "true", 45 | "RunOnceActivity.ShowReadmeOnStart": "true", 46 | "WebServerToolWindowFactoryState": "false", 47 | "last_opened_file_path": "/Users/anton/Desktop/Development/Python/telegram_bot/Open_bot/pastebin-bot", 48 | "node.js.detected.package.eslint": "true", 49 | "node.js.detected.package.tslint": "true", 50 | "node.js.selected.package.eslint": "(autodetect)", 51 | "node.js.selected.package.tslint": "(autodetect)", 52 | "settings.editor.selected.configurable": "preferences.lookFeel" 53 | } 54 | } 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 86 | 87 | 88 | 108 | 109 | 110 | 130 | 131 | 132 | 152 | 153 | 154 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 1658833463732 189 | 197 | 198 | 199 | 200 | 202 | 203 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | -------------------------------------------------------------------------------- /.idea/shelf/Uncommitted_changes_before_Checkout_at_26_08_22,_1_56_AM_[Changes]/shelved.patch: -------------------------------------------------------------------------------- 1 | Index: .idea/workspace.xml 2 | IDEA additional info: 3 | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP 4 | <+>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n "keyToString": {\n "RunOnceActivity.OpenProjectViewOnStart": "true",\n "RunOnceActivity.ShowReadmeOnStart": "true",\n "WebServerToolWindowFactoryState": "false",\n "last_opened_file_path": "/Users/anton/Desktop/Development/Python/telegram_bot/Open_bot/pastebin-bot",\n "node.js.detected.package.eslint": "true",\n "node.js.detected.package.tslint": "true",\n "node.js.selected.package.eslint": "(autodetect)",\n "node.js.selected.package.tslint": "(autodetect)",\n "settings.editor.selected.configurable": "preferences.lookFeel"\n }\n}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 1658833463732\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 5 | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP 6 | <+>UTF-8 7 | =================================================================== 8 | diff --git a/.idea/workspace.xml b/.idea/workspace.xml 9 | --- a/.idea/workspace.xml (revision 2bdba4f8868b38a07a4f99113bac3a4f12ab535e) 10 | +++ b/.idea/workspace.xml (date 1661459159899) 11 | @@ -5,7 +5,7 @@ 12 | 13 | 14 | 15 | - 16 | + 17 | 18 | 30 | -------------------------------------------------------------------------------- /.idea/shelf/Uncommitted_changes_before_Checkout_at_25_08_22,_11_06_PM_[Changes]/shelved.patch: -------------------------------------------------------------------------------- 1 | Index: .idea/workspace.xml 2 | IDEA additional info: 3 | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP 4 | <+>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 1658833463732\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 5 | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP 6 | <+>UTF-8 7 | =================================================================== 8 | diff --git a/.idea/workspace.xml b/.idea/workspace.xml 9 | --- a/.idea/workspace.xml (revision 541408801085ce9beb9ec504a52051fcecf7b49f) 10 | +++ b/.idea/workspace.xml (date 1661361643664) 11 | @@ -5,11 +5,6 @@ 12 | 13 | 14 | 15 | - 16 | - 17 | - 18 | - 19 | - 20 | 21 | 22 | 23 | @@ -26,6 +21,11 @@ 24 | 25 | 26 | 27 | + 32 | 34 | 35 | @@ -40,18 +40,18 @@ 36 | 39 | - { 50 | + "keyToString": { 51 | + "RunOnceActivity.OpenProjectViewOnStart": "true", 52 | + "RunOnceActivity.ShowReadmeOnStart": "true", 53 | + "WebServerToolWindowFactoryState": "false", 54 | + "last_opened_file_path": "/Users/anton/Desktop/Development/Python/telegram_bot/Open_bot/pastebin-bot", 55 | + "node.js.detected.package.eslint": "true", 56 | + "node.js.detected.package.tslint": "true", 57 | + "node.js.selected.package.eslint": "(autodetect)", 58 | + "node.js.selected.package.tslint": "(autodetect)" 59 | } 60 | -}]]> 61 | +} 62 | 63 | 64 | 65 | @@ -211,10 +211,14 @@ 66 | 67 | 68 | 69 | + 70 | 71 | 72 | + 73 | 74 | + 75 | + 76 | 77 | - 78 | + 79 | 80 | 81 | \ No newline at end of file 82 | -------------------------------------------------------------------------------- /.idea/shelf/Uncommitted_changes_before_Checkout_at_24_08_22,_10_49_PM_[Changes]/shelved.patch: -------------------------------------------------------------------------------- 1 | Index: pastebin-bot/bot.py 2 | IDEA additional info: 3 | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP 4 | <+>from API import API_KEY\nimport telegram.ext\nimport os, subprocess\nfrom request import file_writer, file_remover\nfrom insta_profile import profile_downloader, profile_delete\nfrom qr_generator import generate_qr, delete_qr\nfrom quotes import preload_quotes, quotes\nfrom random import randint\nfrom love_quotes import happy_love_quotes, sad_love_quotes\nfrom yt_download_shorts import download_video, get_title\nimport instaloader\n\n\ndef handle_message(update, context):\n user_first_name = update.message.chat.first_name\n user_last_name = update.message.chat.last_name\n username = update.message.chat.username\n update.message.reply_text(\n f\"Hey\uD83D\uDC4B {user_first_name} {user_last_name} aka @{username} welcome to the Open-Bot type: /help to explore options.\"\n )\n\n\ndef start(update, context):\n update.message.reply_text(\n \"Welcome to Open-Bot Powered by Open-Source and Developed by @thisiskanishkP\"\n )\n context.bot.send_photo(\n chat_id=update.message.chat_id, photo=open(\"images/octocat.png\", \"rb\")\n )\n\n\ndef help(update, context):\n update.message.reply_text(\n \"\"\"\n \n The Following Commands can we user\n \n /start - to say welcome message\n /help - to get help\n /paste - to push content to paste.rs\n /pic - to download a profile pic of the user\n /qr - to generate qr code\n /quote - for getting random quotes\n /love_quote_happy - for romantic quotes [happy]\n /love_quote_sad - for romantic quotes [sad]\n /yt_dl - to download a youtube video.......[it may take sometime to download a youtube video so chill]\n \"\"\"\n )\n\n\ndef paste(update, context):\n data = context.args[::]\n listToStr = \" \".join(map(str, data))\n file_writer(text=listToStr)\n output = subprocess.check_output(\n \"curl --data-binary @file.txt https://paste.rs/\", shell=True\n )\n update.message.reply_text(f\"{output.decode('utf-8')}\")\n file_remover()\n\n\ndef pic(update, context):\n username = context.args[0]\n try:\n update.message.reply_text(\n f\"Please wait while we are sending you the profile pic of {username} \\n Don't worry it will take a minute or so \uD83E\uDD1D\"\n )\n profile_downloader(username=username)\n for root, subdirs, files in os.walk(username):\n for file in files:\n if os.path.splitext(file)[1].lower() in (\".jpg\", \".jpeg\"):\n context.bot.send_photo(\n chat_id=update.message.chat_id,\n photo=open(f\"{os.path.join(root, file)}\", \"rb\"),\n )\n profile_delete(username=username)\n except:\n update.message.reply_text(f\"{username} is not found\")\n\n\ndef qr(update, context):\n link = context.args[0]\n try:\n generate_qr(link=link)\n context.bot.send_photo(\n chat_id=update.message.chat_id, photo=open(\"myqr.png\", \"rb\")\n )\n delete_qr()\n except:\n update.message.reply_text(f\"QR of this {link} can't be generated\")\n delete_qr()\n\n\ndef quote(update, context):\n preload_quotes()\n update.message.reply_text(f\"{quotes[randint(0, 9)]}\")\n\n\ndef love_quote_happy(update, context):\n update.message.reply_text(f\"❤️ {happy_love_quotes[randint(0, 22)]}\")\n\n\ndef love_quote_sad(update, context):\n update.message.reply_text(f\"❤️ {sad_love_quotes[randint(0, 3)]}\")\n\n\ndef video_download_yt(update, context):\n link_video = context.args[0]\n try:\n update.message.reply_text(\n \"Please wait while the Video is Downloading, It may take 3-5 minutes to download a 20 mb video \uD83D\uDE4F\"\n )\n download_video(link_video)\n context.bot.send_video(\n chat_id=update.message.chat_id,\n video=open(f\"output.mp4\", \"rb\"),\n supports_streaming=True,\n )\n if os.path.exists(f\"output.mp4\"):\n os.remove(f\"output.mp4\")\n except instaloader.ProfileNotExistsException:\n update.message.reply_text(f\"{link_video} is not Found\")\n except instaloader.ConnectionException:\n update.message.reply_text(\"IP is Blocked Please Try After Some Time\")\n\n\nupdater = telegram.ext.Updater(API_KEY, use_context=True)\n\ndisp = updater.dispatcher\n\ndisp.add_handler(telegram.ext.CommandHandler(\"start\", start))\ndisp.add_handler(telegram.ext.CommandHandler(\"help\", help))\ndisp.add_handler(telegram.ext.CommandHandler(\"paste\", paste))\ndisp.add_handler(telegram.ext.CommandHandler(\"pic\", pic))\ndisp.add_handler(telegram.ext.CommandHandler(\"qr\", qr))\ndisp.add_handler(telegram.ext.CommandHandler(\"quote\", quote))\ndisp.add_handler(telegram.ext.CommandHandler(\"love_quote_happy\", love_quote_happy))\ndisp.add_handler(telegram.ext.CommandHandler(\"love_quote_sad\", love_quote_sad))\ndisp.add_handler(telegram.ext.CommandHandler(\"yt_dl\", video_download_yt))\ndisp.add_handler(telegram.ext.MessageHandler(telegram.ext.Filters.text, handle_message))\n\nif __name__ == \"__main__\":\n updater.start_polling()\n updater.idle()\n 5 | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP 6 | <+>UTF-8 7 | =================================================================== 8 | diff --git a/pastebin-bot/bot.py b/pastebin-bot/bot.py 9 | --- a/pastebin-bot/bot.py (revision 16618e7d80ea2a8d89e47352a43133d17d1c9c93) 10 | +++ b/pastebin-bot/bot.py (date 1661361552837) 11 | @@ -129,7 +129,7 @@ 12 | disp = updater.dispatcher 13 | 14 | disp.add_handler(telegram.ext.CommandHandler("start", start)) 15 | -disp.add_handler(telegram.ext.CommandHandler("help", help)) 16 | +disp.add_handler(telegram.ext.CommandHandler("help", help )) 17 | disp.add_handler(telegram.ext.CommandHandler("paste", paste)) 18 | disp.add_handler(telegram.ext.CommandHandler("pic", pic)) 19 | disp.add_handler(telegram.ext.CommandHandler("qr", qr)) 20 | Index: .idea/workspace.xml 21 | IDEA additional info: 22 | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP 23 | <+>\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n "keyToString": {\n "RunOnceActivity.OpenProjectViewOnStart": "true",\n "RunOnceActivity.ShowReadmeOnStart": "true",\n "WebServerToolWindowFactoryState": "false",\n "last_opened_file_path": "/Users/anton/Desktop/Development/Python/telegram_bot/Open_bot/pastebin-bot",\n "node.js.detected.package.eslint": "true",\n "node.js.detected.package.tslint": "true",\n "node.js.selected.package.eslint": "(autodetect)",\n "node.js.selected.package.tslint": "(autodetect)"\n }\n}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 1658833463732\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 24 | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP 25 | <+>UTF-8 26 | =================================================================== 27 | diff --git a/.idea/workspace.xml b/.idea/workspace.xml 28 | --- a/.idea/workspace.xml (revision 16618e7d80ea2a8d89e47352a43133d17d1c9c93) 29 | +++ b/.idea/workspace.xml (date 1661361513530) 30 | @@ -5,13 +5,8 @@ 31 | 32 | 33 | 34 | - 35 | - 36 | - 37 | - 38 | - 39 | 40 | - 41 | + 42 | 43 | 53 | @@ -191,6 +187,12 @@ 54 | 1658833463732 55 | 56 | 57 | + 58 | + 59 | + 60 | + 61 | + 62 | + 63 | 64 | 65 | 66 | @@ -219,6 +221,6 @@ 67 | 68 | 69 | 70 | - 71 | + 72 | 73 | 74 | \ No newline at end of file 75 | --------------------------------------------------------------------------------