Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- import os, random, urllib, webbrowser
- baselink = "https://www.mangaupdates.com/series.html?id="
- #Add a hash in front of genres you want to include
- #There are a million Categories, just add a new line for Categories that you want to include/exclude
- #For example, you want only random Fantasy manga that won an award
- #Things I Don't Like = Only hash """genre=Fantasy""",
- #Things I like = """category=Award-Winning+Work""",
- #Remove hash from elseif statements
- #The triple quotes means it searches the HTML of the MU page
- Things_I_dont_like = [
- "You specified an invalid series id.",
- "You must login to see Hentai related images.",
- " dj ",
- """>Novel""",
- """>Manhwa""",
- #""">Oneshot""",
- #"""category=Award-Winning+Work""",
- #"""category=Award-Nominated+Work""",
- """genre=Yaoi""",
- """genre=Josei""",
- """genre=Harem""",
- """genre=Sports""",
- """genre=Shoujo""",
- """genre=Shotacon""",
- """genre=Shoujo+Ai""",
- """genre=Shounen+Ai""",
- """genre=Yuri""",
- """genre=Doujinshi""",
- """genre=Ecchi""",
- """genre=Gender+Bender""",
- """genre=Hentai""",
- #"""genre=Seinen""",
- #"""genre=Shounen""",
- #"""genre=Lolicon""",
- #"""genre=Action""",
- #"""genre=Adventure""",
- #"""genre=Horror""",
- #"""genre=Mature""",
- #"""genre=Mystery""",
- #"""genre=Romance""",
- #"""genre=Sci-fi""",
- #"""genre=Smut""",
- #"""genre=Supernatural""",
- #"""genre=Adult""",
- #"""genre=Comedy""",
- #"""genre=Drama""",
- #"""genre=Fantasy""",
- #"""genre=Historical""",
- #"""genre=Martial Arts""",
- #"""genre=Mecha""",
- #"""genre=Psychological""",
- #"""genre=School+Life""",
- #"""genre=Slice+of+Life""",
- #"""genre=Tragedy""",
- """<div class="sCat"><b>Completely Scanlated?</b></div>\n<div class="sContent" >No\n</div>""",
- """<u>Report Inappropriate Content</u></a>]</div>\n<div class="sContent" >N/A\n</div>""",
- ]
- #Criteria you want to include anyway, if they show up for Things I Don't Like
- #Things_I_like = [
- #"""category=Award-Winning+Work""",
- #"""category=Award-Nominated+Work""",
- #]
- valid = False
- while not valid:
- num = random.randint(1,109400)
- link = "%s%d" % (baselink, num)
- urllib.urlretrieve(link, "temp.html")
- page = open("temp.html").read()
- if any(thing in page for thing in Things_I_dont_like):
- print (link, "Nope.")
- #elif not any(thing in page for thing in Things_I_like):
- #print (link, "Nope.")
- else:
- webbrowser.open(link)
- os.remove("temp.html")
- valid = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement