settings.py 1.5 KB

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