chore(style): Black style
This commit is contained in:
@@ -2,6 +2,7 @@ import requests
|
||||
from nyaapy import torrent
|
||||
from nyaapy.parser import parse_nyaa, parse_single, parse_nyaa_rss
|
||||
|
||||
|
||||
class AnimeTorrentSite:
|
||||
SITE = torrent.TorrentSite.NYAASI
|
||||
URL = "https://nyaa.si"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import urllib
|
||||
from urllib.parse import urlencode
|
||||
|
||||
|
||||
def magnet_builder(info_hash, title):
|
||||
"""
|
||||
Generates a magnet link using the info_hash and title of a given file.
|
||||
@@ -19,4 +20,4 @@ def magnet_builder(info_hash, title):
|
||||
for tracker in known_trackers:
|
||||
magnet_link += f"&{urlencode({'tr': tracker})}"
|
||||
|
||||
return magnet_link
|
||||
return magnet_link
|
||||
|
||||
@@ -4,4 +4,4 @@ from nyaapy.torrent import TorrentSite
|
||||
|
||||
class Nyaa(AnimeTorrentSite):
|
||||
SITE = TorrentSite.NYAASI
|
||||
URL = "https://nyaa.si"
|
||||
URL = "https://nyaa.si"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from nyaapy.anime_site import AnimeTorrentSite
|
||||
from nyaapy.torrent import TorrentSite
|
||||
|
||||
|
||||
class SukebeiNyaa(AnimeTorrentSite):
|
||||
SITE = TorrentSite.SUKEBEINYAASI
|
||||
URL = "https://sukebei.nyaa.si"
|
||||
URL = "https://sukebei.nyaa.si"
|
||||
|
||||
@@ -2,6 +2,7 @@ from lxml import etree
|
||||
from nyaapy.magnet import magnet_builder
|
||||
from nyaapy.torrent import TorrentSite
|
||||
|
||||
|
||||
def nyaa_categories(b):
|
||||
c = b.replace("?c=", "")
|
||||
cats = c.split("_")
|
||||
|
||||
@@ -12,12 +12,14 @@ def json_to_class(data):
|
||||
else:
|
||||
return Torrent(data)
|
||||
|
||||
|
||||
# This deals with converting the dict to an object
|
||||
class Torrent(object):
|
||||
def __init__(self, my_dict):
|
||||
for key in my_dict:
|
||||
setattr(self, key, my_dict[key])
|
||||
|
||||
|
||||
class TorrentSite(Enum):
|
||||
"""
|
||||
Contains torrent sites
|
||||
@@ -25,5 +27,5 @@ class TorrentSite(Enum):
|
||||
|
||||
NYAASI = "https://nyaa.si"
|
||||
SUKEBEINYAASI = "https://sukebei.nyaa.si"
|
||||
|
||||
NYAALAND = "https://nyaa.land"
|
||||
|
||||
NYAALAND = "https://nyaa.land"
|
||||
|
||||
Reference in New Issue
Block a user