You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
4.7 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. # -*- coding: UTF-8 -*-
  2. import gettext
  3. from .utils import TwoWayOrderedDict as tdict
  4. OUTPUT_FORMATS = tdict([
  5. (0, _("ID")),
  6. (1, _("Title")),
  7. (2, _("Title + ID")),
  8. (4, _("Title + Quality")),
  9. (5, _("Title + ID + Quality")),
  10. (3, _("Custom"))
  11. ])
  12. DEFAULT_FORMATS = tdict([
  13. ("0", _("default"))
  14. ])
  15. VIDEO_FORMATS = tdict([
  16. ("3gp", "3gp"),
  17. ("17", "3gp [144p]"),
  18. ("36", "3gp [240p]"),
  19. ("flv", "flv"),
  20. ("5", "flv [240p]"),
  21. ("34", "flv [360p]"),
  22. ("35", "flv [480p]"),
  23. ("webm", "webm"),
  24. ("43", "webm [360p]"),
  25. ("44", "webm [480p]"),
  26. ("45", "webm [720p]"),
  27. ("46", "webm [1080p]"),
  28. ("mp4", "mp4"),
  29. ("18", "mp4 [360p]"),
  30. ("22", "mp4 [720p]"),
  31. ("37", "mp4 [1080p]"),
  32. ("38", "mp4 [4K]"),
  33. ("160", "mp4 [144p] (DASH Video)"),
  34. ("133", "mp4 [240p] (DASH Video)"),
  35. ("134", "mp4 [360p] (DASH Video)"),
  36. ("135", "mp4 [480p] (DASH Video)"),
  37. ("136", "mp4 [720p] (DASH Video)"),
  38. ("137", "mp4 [1080p] (DASH Video)"),
  39. ("264", "mp4 [1440p] (DASH Video)"),
  40. ("138", "mp4 [2160p] (DASH Video)"),
  41. ("242", "webm [240p] (DASH Video)"),
  42. ("243", "webm [360p] (DASH Video)"),
  43. ("244", "webm [480p] (DASH Video)"),
  44. ("247", "webm [720p] (DASH Video)"),
  45. ("248", "webm [1080p] (DASH Video)"),
  46. ("271", "webm [1440p] (DASH Video)"),
  47. ("272", "webm [2160p] (DASH Video)"),
  48. ("82", "mp4 [360p] (3D)"),
  49. ("83", "mp4 [480p] (3D)"),
  50. ("84", "mp4 [720p] (3D)"),
  51. ("85", "mp4 [1080p] (3D)"),
  52. ("100", "webm [360p] (3D)"),
  53. ("101", "webm [480p] (3D)"),
  54. ("102", "webm [720p] (3D)"),
  55. ("139", "m4a 48k (DASH Audio)"),
  56. ("140", "m4a 128k (DASH Audio)"),
  57. ("141", "m4a 256k (DASH Audio)"),
  58. ("171", "webm 48k (DASH Audio)"),
  59. ("172", "webm 256k (DASH Audio)")
  60. ])
  61. AUDIO_FORMATS = tdict([
  62. ("mp3", "mp3"),
  63. ("wav", "wav"),
  64. ("aac", "aac"),
  65. ("m4a", "m4a"),
  66. ("vorbis", "vorbis"),
  67. ("opus", "opus"),
  68. ("flac", "flac")
  69. ])
  70. FORMATS = DEFAULT_FORMATS.copy()
  71. FORMATS.update(VIDEO_FORMATS)
  72. FORMATS.update(AUDIO_FORMATS)
  73. def reload_strings():
  74. # IF YOU DONT WANT YOUR EYES TO BLEED STOP HERE
  75. # YOU HAVE BEEN WARNED
  76. # DO NOT LOOK THE CODE BELOW
  77. #
  78. #
  79. #
  80. #
  81. #
  82. #
  83. #
  84. #
  85. #NOTE Remove
  86. # Code is so messed up that i need to reload strings else
  87. # the translations wont work on the about gettext tags
  88. global OUTPUT_FORMATS
  89. global DEFAULT_FORMATS
  90. global VIDEO_FORMATS
  91. global AUDIO_FORMATS
  92. global FORMATS
  93. OUTPUT_FORMATS = tdict([
  94. (0, _("ID")),
  95. (1, _("Title")),
  96. (2, _("Title + ID")),
  97. (4, _("Title + Quality")),
  98. (5, _("Title + ID + Quality")),
  99. (3, _("Custom"))
  100. ])
  101. DEFAULT_FORMATS = tdict([
  102. ("0", _("default"))
  103. ])
  104. VIDEO_FORMATS = tdict([
  105. ("3gp", "3gp"),
  106. ("17", "3gp [144p]"),
  107. ("36", "3gp [240p]"),
  108. ("flv", "flv"),
  109. ("5", "flv [240p]"),
  110. ("34", "flv [360p]"),
  111. ("35", "flv [480p]"),
  112. ("webm", "webm"),
  113. ("43", "webm [360p]"),
  114. ("44", "webm [480p]"),
  115. ("45", "webm [720p]"),
  116. ("46", "webm [1080p]"),
  117. ("mp4", "mp4"),
  118. ("18", "mp4 [360p]"),
  119. ("22", "mp4 [720p]"),
  120. ("37", "mp4 [1080p]"),
  121. ("38", "mp4 [4K]"),
  122. ("160", "mp4 [144p] (DASH Video)"),
  123. ("133", "mp4 [240p] (DASH Video)"),
  124. ("134", "mp4 [360p] (DASH Video)"),
  125. ("135", "mp4 [480p] (DASH Video)"),
  126. ("136", "mp4 [720p] (DASH Video)"),
  127. ("137", "mp4 [1080p] (DASH Video)"),
  128. ("264", "mp4 [1440p] (DASH Video)"),
  129. ("138", "mp4 [2160p] (DASH Video)"),
  130. ("242", "webm [240p] (DASH Video)"),
  131. ("243", "webm [360p] (DASH Video)"),
  132. ("244", "webm [480p] (DASH Video)"),
  133. ("247", "webm [720p] (DASH Video)"),
  134. ("248", "webm [1080p] (DASH Video)"),
  135. ("271", "webm [1440p] (DASH Video)"),
  136. ("272", "webm [2160p] (DASH Video)"),
  137. ("82", "mp4 [360p] (3D)"),
  138. ("83", "mp4 [480p] (3D)"),
  139. ("84", "mp4 [720p] (3D)"),
  140. ("85", "mp4 [1080p] (3D)"),
  141. ("100", "webm [360p] (3D)"),
  142. ("101", "webm [480p] (3D)"),
  143. ("102", "webm [720p] (3D)"),
  144. ("139", "m4a 48k (DASH Audio)"),
  145. ("140", "m4a 128k (DASH Audio)"),
  146. ("141", "m4a 256k (DASH Audio)"),
  147. ("171", "webm 48k (DASH Audio)"),
  148. ("172", "webm 256k (DASH Audio)")
  149. ])
  150. AUDIO_FORMATS = tdict([
  151. ("mp3", "mp3"),
  152. ("wav", "wav"),
  153. ("aac", "aac"),
  154. ("m4a", "m4a"),
  155. ("vorbis", "vorbis"),
  156. ("opus", "opus"),
  157. ("flac", "flac")
  158. ])
  159. FORMATS = DEFAULT_FORMATS.copy()
  160. FORMATS.update(VIDEO_FORMATS)
  161. FORMATS.update(AUDIO_FORMATS)