31 lines
748 B
Python
31 lines
748 B
Python
#!/usr/bin/python3
|
|
|
|
from utils import *
|
|
from download_page import download
|
|
|
|
# portable code to get filename
|
|
import os
|
|
platform = os.path.basename(__file__)
|
|
if platform.endswith(".py"):
|
|
platform = platform[:(-3)]
|
|
|
|
def extract_from_url (url, verbosity):
|
|
# split into domain and path
|
|
index = url.find("/",url.find("//")+2)
|
|
domain = url[:index]
|
|
path = url[index:]
|
|
|
|
index = path.find('/', 1)
|
|
if index < 0:
|
|
username = path[1:]
|
|
else:
|
|
username = path[1:index]
|
|
|
|
if username:
|
|
return "https://backend.deviantart.com/rss.xml?type=deviation&q=by%3A" + username + "+sort%3Atime+meta%3Aall"
|
|
|
|
|
|
def extract (url, page=None, network=False, verbosity=3, args={}):
|
|
# I don't have a more robust way to do this.
|
|
return extract_from_url (url, verbosity)
|