settings.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. from kddit import app
  2. ROOT = app.config["kddit.root"]
  3. TIMESHIFT = int(app.config["kddit.timeshift"])
  4. PROXY_ALLOW = {
  5. "image": [
  6. "preview.redd.it",
  7. "i.redd.it",
  8. "v.redd.it",
  9. "b.thumbs.redditmedia.com",
  10. "society.kalli.st",
  11. "i.kalli.st",
  12. "preview.redd.it",
  13. "emoji.redditmedia.com",
  14. "i.ytimg.com",
  15. "www.redditstatic.com",
  16. "i.imgur.com",
  17. "i.imgflip.com",
  18. "external-preview.redd.it",
  19. "thumbs.gfycat.com"
  20. ],
  21. "video": [
  22. "v.redd.it",
  23. "youtu.be",
  24. "gfycat.com",
  25. "redgifs.com",
  26. "www.redgifs.com"],
  27. "youtube": [
  28. "youtu.be",
  29. "www.youtube.com",
  30. "m.youtube.com"],
  31. "imgur": [
  32. "i.imgur.com"]
  33. }
  34. DEFAULT_OPTION = "hot"
  35. SUBREDDIT_OPTIONS = ["hot", "new", "top", "rising", "controversial"]
  36. USER_OPTIONS = ["overview", "comments", "submitted"]
  37. USER_SORT = ["hot", "new", "top", "controversial"]
  38. SEARCH_SORT = ["relevance", "top", "new", "comments"]
  39. EXPANDED_OPTIONS = ["top", "controversial"]
  40. TIME_OPTIONS = {
  41. "hour": "now",
  42. "day": "today",
  43. "week": "this week",
  44. "month": "this month",
  45. "year": "this year",
  46. "all": "all time"
  47. }
  48. SAFE_SUBS = ["all", "random"]
  49. FILE_PATH = f"{ROOT}/videos/"
  50. UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
  51. HEADERS = {
  52. "User-Agent": UA
  53. }
  54. YDL_OPTS = {
  55. 'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4',
  56. 'merge-output-format': 'mp4',
  57. 'outtmpl': FILE_PATH + '%(id)s.%(ext)s'
  58. }