-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Beta-5 * Fixed some issues and mispellings * Added /admin command to know the status * Register users in a database * Users now have multiple language choices and changeability of it's language in database * Inline mode deactivated until the real database is ready * Delete DE.py * Delete ES.py * Delete PT.py * Delete RU.py * Delete EN.txt
- Loading branch information
Showing
14 changed files
with
1,154 additions
and
81 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
Binary file not shown.
Binary file not shown.
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,28 @@ | ||
# -*- utf-8 -*- | ||
# Tag database code | ||
|
||
import random | ||
from tinydb import Query, TinyDB | ||
import requests | ||
from API import Img | ||
|
||
def grabber(): | ||
l = Img.Requests(site_name='yandere', api_name='tags_list', param='limit') | ||
|
||
random_page = random.sample(range(1, 64075), 1) | ||
random_page_number = random_page[0] | ||
url = '{site_url}{api_name}{param}{page}'.format(site_url=l.site_url, api_name=l.api_name, login=l.username, | ||
password=l.password_hash, param=l.param, | ||
page='&page='+str(int(random_page_number))) | ||
|
||
req = requests.get(url) | ||
|
||
ret = req.json() | ||
db = TinyDB('db.json') | ||
db.insert(ret[0]) | ||
|
||
while True: | ||
try: | ||
grabber() | ||
except: | ||
print("Error") |
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
Oops, something went wrong.