├── LICENSE ├── Procfile ├── README.md ├── app.json ├── main.py └── requirements.txt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Pranav Ajay 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | Worker: python main.py 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoHentai 2 | All the new recent hentai will be uploaded in telegram channel in Telegram streamable format. 3 | 4 | ## How To Host 5 | The easiest way to deploy this Bot 6 | • Enter your ```API_ID```,```API_HASH``` And ```BOT_TOKEN```. 7 |

8 | 9 | 10 | ### Reach Me 11 | 12 |

13 | 14 |

15 | 16 |

17 | 18 | ## © Copyright - MetaVoid (Moezilla) 19 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@autohentai", 3 | "repository": "https://github.com/MoeZilla/autohentai", 4 | "env": { 5 | "BOT_TOKEN": { 6 | "description": "telegram bot token here", 7 | "required": true 8 | }, 9 | "CHANNEL_ID": { 10 | "description": "example -1001658064061", 11 | "required": true 12 | }, 13 | "CHANNEL_USERNAME": { 14 | "description": "example @autohentai", 15 | "required": true 16 | }, 17 | "MONGO_URL": { 18 | "description": "mongo db url", 19 | "required": true 20 | }, 21 | "API_ID": { 22 | "description": "telegram api id here", 23 | "required": true 24 | }, 25 | "API_HASH": { 26 | "description": "telegram api hash here", 27 | "required": true 28 | } 29 | }, 30 | "buildpacks": [ 31 | {"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git"}, 32 | {"url": "heroku/python"} 33 | ], 34 | "addons": [ 35 | { 36 | "plan": "heroku-postgresql" 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from pyrogram import Client, filters 2 | from pyrogram.types import * 3 | import json 4 | import os 5 | import requests 6 | import subprocess 7 | from pymongo import MongoClient 8 | from apscheduler.schedulers.asyncio import AsyncIOScheduler 9 | 10 | 11 | API_ID = os.environ.get("API_ID", None) 12 | MONGO_URL = os.environ.get("MONGO_URL", None) 13 | API_HASH = os.environ.get("API_HASH", None) 14 | BOT_TOKEN = os.environ.get("BOT_TOKEN", None) 15 | CHANNEL_ID = os.environ.get(int("CHANNEL_ID")) 16 | CHANNEL_USERNAME = os.environ.get("CHANNEL_USERNAME", None) 17 | 18 | app = Client( 19 | "hentai", 20 | api_id=API_ID, 21 | api_hash=API_HASH, 22 | bot_token=BOT_TOKEN 23 | ) 24 | 25 | 26 | async def autohentai_parser(): 27 | hentaidb = MongoClient(MONGO_URL) 28 | hentai = hentaidb["HentaiDb"]["Name"] 29 | url = f"https://hanime.metavoid.info/recent" 30 | result = requests.get(url) 31 | result = result.json() 32 | url = result["reposone"][0]["slug"] 33 | name = result["reposone"][0]["name"] 34 | img = result["reposone"][0]["poster_url"] 35 | is_hentai = hentai.find_one({"url": url}) 36 | if not is_hentai: 37 | l = f"https://hanime.metavoid.info/link?id={url}" 38 | k = requests.get(l) 39 | data = k.json() 40 | k = data["data"][0]["url"] 41 | if not k == "": 42 | url1 = data["data"][0]["url"] 43 | url2 = data["data"][1]["url"] 44 | url3 = data["data"][2]["url"] 45 | file1 = f'{url}-720p.mp4' 46 | file2 = f'{url}-480p.mp4' 47 | file3 = f'{url}-360p.mp4' 48 | gay = requests.get(img) 49 | open('themb.jpg', 'wb').write(gay.content) 50 | image = 'themb.jpg' 51 | subprocess.run("ffmpeg -i {} -acodec copy -vcodec copy {}".format( 52 | url1, file1), 53 | shell=True) 54 | subprocess.run("ffmpeg -i {} -acodec copy -vcodec copy {}".format( 55 | url2, file2), 56 | shell=True) 57 | subprocess.run("ffmpeg -i {} -acodec copy -vcodec copy {}".format( 58 | url3, file3), 59 | shell=True) 60 | hentai.insert_one({"url": url}) 61 | await app.send_video(CHANNEL_ID, 62 | file1, 63 | thumb=f'{image}', 64 | caption=f'[{CHANNEL_USERNAME}] {name} - 720p') 65 | await app.send_video(CHANNEL_ID, 66 | file2, 67 | thumb=f'{image}', 68 | caption=f'[{CHANNEL_USERNAME}] {name} - 480p') 69 | await app.send_video(CHANNEL_ID, 70 | file3, 71 | thumb=f'{image}', 72 | caption=f'[{CHANNEL_USERNAME}] {name} - 360p') 73 | os.remove(file1) 74 | os.remove(file2) 75 | os.remove(file3) 76 | os.remove(image) 77 | if k == "": 78 | url1 = data["data"][1]["url"] 79 | url2 = data["data"][2]["url"] 80 | url3 = data["data"][3]["url"] 81 | file1 = f'{url}-720p.mp4' 82 | file2 = f'{url}-480p.mp4' 83 | file3 = f'{url}-360p.mp4' 84 | gay = requests.get(img) 85 | open('themb.jpg', 'wb').write(gay.content) 86 | image = 'themb.jpg' 87 | subprocess.run("ffmpeg -i {} -acodec copy -vcodec copy {}".format( 88 | url1, file1), 89 | shell=True) 90 | subprocess.run("ffmpeg -i {} -acodec copy -vcodec copy {}".format( 91 | url2, file2), 92 | shell=True) 93 | subprocess.run("ffmpeg -i {} -acodec copy -vcodec copy {}".format( 94 | url3, file3), 95 | shell=True) 96 | hentai.insert_one({"url": url}) 97 | await app.send_video(CHANNEL_ID, 98 | file1, 99 | thumb=f'{image}', 100 | caption=f'[{CHANNEL_USERNAME}] {name} - 720p') 101 | await app.send_video(CHANNEL_ID, 102 | file2, 103 | thumb=f'{image}', 104 | caption=f'[{CHANNEL_USERNAME}] {name} - 480p') 105 | await app.send_video(CHANNEL_ID, 106 | file3, 107 | thumb=f'{image}', 108 | caption=f'[{CHANNEL_USERNAME}] {name} - 360p') 109 | os.remove(file1) 110 | os.remove(file2) 111 | os.remove(file3) 112 | os.remove(image) 113 | 114 | 115 | scheduler = AsyncIOScheduler() 116 | scheduler.add_job(autohentai_parser, "interval", minutes=1) 117 | scheduler.start() 118 | 119 | 120 | app.run() 121 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pyrogram==1.4.16 2 | requests 3 | ffmpeg 4 | apscheduler 5 | pymongo 6 | tgcrypto==1.2.2 7 | dnspython 8 | --------------------------------------------------------------------------------