Advertisement
TheStro

Untitled

Jul 28th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. import os
  2. import re
  3. import random
  4. import sys
  5. import json
  6. import time
  7. import datetime
  8. import base64
  9. import urllib
  10.  
  11. if sys.version_info[0] < 3:
  12. class urllib:
  13. parse = __import__("urllib")
  14. request = __import__("urllib2")
  15. input = raw_input
  16. import codecs
  17. import Queue as queue
  18. class http:
  19. client = __import__("httplib")
  20. else:
  21. import http.client
  22. import queue
  23. import urllib.request
  24. import urllib.parse
  25.  
  26.  
  27. def getAnimeInfo(args):
  28. raw_data = urllib.request.urlopen("http://31.220.49.92:61785/api/myanimelist.py?cmd=anime&args=%s"%(args)).read().decode("utf-8")
  29. data = json.loads(raw_data)
  30. newset = list()
  31. for anime in data:
  32. image = anime["image"]
  33. idanime = anime["id"]
  34. title = anime["title"]
  35. english = anime["english"]
  36. japanese = anime["japanese"]
  37. genres = anime["genres"]
  38. producers = anime["producers"]
  39. episodes = anime["episodes"]
  40. score = anime["score"]
  41. duration = anime["duration"]
  42. rating = anime["rating"]
  43. typeanime = anime["type"]
  44. status = anime["status"]
  45. start_date = anime["start_date"]
  46. end_date = anime["end_date"]
  47. synopsis = anime["synopsis"]
  48. newset.append("Image: %s <br />ID: %s <br />Title: %s <br />English name: %s <br />Japanese name: %s <br />Genres: %s <br />Producers: %s <br />Episodes: %s <br />Score: %s <br />Duration: %s <br />Rating: %s <br />Type: %s <br />Status: %s <br />Start date: %s <br />End date: %s <br />Synopsis: %s " % (image, idanime, title, english, japanese, genres, producers, episodes, score, duration, rating, typeanime, status, start_date, end_date, synopsis))
  49. return newset[0]
  50.  
  51.  
  52. def getMangaInfo(args):
  53. raw_data = urllib.request.urlopen("http://31.220.49.92:61785/api/myanimelist.py?cmd=manga&args=%s"%(args)).read().decode("utf-8")
  54. data = json.loads(raw_data)
  55. newset = list()
  56. for manga in data:
  57. image = manga["image"]
  58. idmanga = manga["id"]
  59. title = manga["title"]
  60. english = manga["english"]
  61. japanese = manga["japanese"]
  62. genres = manga["genres"]
  63. author = manga["author"]
  64. serialization = manga["serialization"]
  65. chapters = manga["chapters"]
  66. volumes = manga["volumes"]
  67. score = manga["score"]
  68. typemanga = manga["type"]
  69. status = manga["status"]
  70. start_date = manga["start_date"]
  71. end_date = manga["end_date"]
  72. synopsis = manga["synopsis"]
  73. newset.append("Image: %s <br />ID: %s <br />Title: %s <br />English name: %s <br />Japanese name: %s <br />Genres: %s <br />Author: %s <br />Serialization: %s <br />Chapters: %s <br />Volumes: %s <br />Score: %s <br />Type: %s <br />Status: %s <br />Start date: %s <br />End date: %s <br />Synopsis: %s " % (image, idmanga, title, english, japanese, genres, author, serialization, chapters, volumes, score, typemanga, status, start_date, end_date, synopsis))
  74. return newset[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement