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.

182 lines
4.6 KiB

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. ])
  69. FORMATS = DEFAULT_FORMATS.copy()
  70. FORMATS.update(VIDEO_FORMATS)
  71. FORMATS.update(AUDIO_FORMATS)
  72. def reload_strings():
  73. # IF YOU DONT WANT YOUR EYES TO BLEED STOP HERE
  74. # YOU HAVE BEEN WARNED
  75. # DO NOT LOOK THE CODE BELOW
  76. #
  77. #
  78. #
  79. #
  80. #
  81. #
  82. #
  83. #
  84. #NOTE Remove
  85. # Code is so messed up that i need to reload strings else
  86. # the translations wont work on the about gettext tags
  87. global OUTPUT_FORMATS
  88. global DEFAULT_FORMATS
  89. global VIDEO_FORMATS
  90. global AUDIO_FORMATS
  91. global FORMATS
  92. OUTPUT_FORMATS = tdict([
  93. (0, _("ID")),
  94. (1, _("Title")),
  95. (2, _("Title + ID")),
  96. (4, _("Title + Quality")),
  97. (5, _("Title + ID + Quality")),
  98. (3, _("Custom"))
  99. ])
  100. DEFAULT_FORMATS = tdict([
  101. ("0", _("default"))
  102. ])
  103. VIDEO_FORMATS = tdict([
  104. ("3gp", "3gp"),
  105. ("17", "3gp [144p]"),
  106. ("36", "3gp [240p]"),
  107. ("flv", "flv"),
  108. ("5", "flv [240p]"),
  109. ("34", "flv [360p]"),
  110. ("35", "flv [480p]"),
  111. ("webm", "webm"),
  112. ("43", "webm [360p]"),
  113. ("44", "webm [480p]"),
  114. ("45", "webm [720p]"),
  115. ("46", "webm [1080p]"),
  116. ("mp4", "mp4"),
  117. ("18", "mp4 [360p]"),
  118. ("22", "mp4 [720p]"),
  119. ("37", "mp4 [1080p]"),
  120. ("38", "mp4 [4K]"),
  121. ("160", "mp4 [144p] (DASH Video)"),
  122. ("133", "mp4 [240p] (DASH Video)"),
  123. ("134", "mp4 [360p] (DASH Video)"),
  124. ("135", "mp4 [480p] (DASH Video)"),
  125. ("136", "mp4 [720p] (DASH Video)"),
  126. ("137", "mp4 [1080p] (DASH Video)"),
  127. ("264", "mp4 [1440p] (DASH Video)"),
  128. ("138", "mp4 [2160p] (DASH Video)"),
  129. ("242", "webm [240p] (DASH Video)"),
  130. ("243", "webm [360p] (DASH Video)"),
  131. ("244", "webm [480p] (DASH Video)"),
  132. ("247", "webm [720p] (DASH Video)"),
  133. ("248", "webm [1080p] (DASH Video)"),
  134. ("271", "webm [1440p] (DASH Video)"),
  135. ("272", "webm [2160p] (DASH Video)"),
  136. ("82", "mp4 [360p] (3D)"),
  137. ("83", "mp4 [480p] (3D)"),
  138. ("84", "mp4 [720p] (3D)"),
  139. ("85", "mp4 [1080p] (3D)"),
  140. ("100", "webm [360p] (3D)"),
  141. ("101", "webm [480p] (3D)"),
  142. ("102", "webm [720p] (3D)"),
  143. ("139", "m4a 48k (DASH Audio)"),
  144. ("140", "m4a 128k (DASH Audio)"),
  145. ("141", "m4a 256k (DASH Audio)"),
  146. ("171", "webm 48k (DASH Audio)"),
  147. ("172", "webm 256k (DASH Audio)")
  148. ])
  149. AUDIO_FORMATS = tdict([
  150. ("mp3", "mp3"),
  151. ("wav", "wav"),
  152. ("aac", "aac"),
  153. ("m4a", "m4a"),
  154. ("vorbis", "vorbis"),
  155. ("opus", "opus")
  156. ])
  157. FORMATS = DEFAULT_FORMATS.copy()
  158. FORMATS.update(VIDEO_FORMATS)
  159. FORMATS.update(AUDIO_FORMATS)