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 typing import List | |
| from itertools import cycle | |
| from os import system as run_cmd | |
| def get_player_id(): | |
| id = 1 | |
| while 1: | |
| yield id | |
| id += 1 |
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 click | |
| import json | |
| import sys | |
| import os | |
| class Configurer: | |
| executable = os.path.abspath(sys.argv[0]) | |
| def save(func, *args, **kwargs): |
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
| def escape(string): | |
| if ('"' in string): | |
| return '"""{}"""'.format(string) | |
| return '"{}"'.format(string) | |
| def listToListOf(list_): | |
| out = [] | |
| for x in list_: | |
| if type(x) in (int, float): |
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
| // Copyright 2021 ArjixWasTaken | |
| const isArray = (obj) => Array.isArray(obj); | |
| const isDict = (obj) => { | |
| if (typeof obj === "object" && !isArray(obj)) return true; | |
| return false; | |
| }; | |
| const isDictEmpty = (obj) => { |
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 bs4 import BeautifulSoup # pip install bs4 | |
| import re | |
| with open(r"PATH/TO/CHAPTERS/XML/FILE.xml", 'r') as f: | |
| soup = BeautifulSoup(f.read(), 'html.parser') | |
| chapters = soup.select('editionentry > chapteratom') | |
| chapters_array = [] |
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
| # This is a wrapper for my API that scrapes Yify (yts.mx) | |
| # Import the API | |
| from YifyAPI.yify import search_yify as search # pip install YifyAPI | |
| # Import the table | |
| from tabulate import tabulate # pip install tabulate | |
| # Import other utilities | |
| import click, os # pip install click |
NewerOlder