README 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. # -*- mode: org; org-html-head-include-default-style: nil; org-html-postamble: nil; -*-
  2. #+OPTIONS: toc:nil num:nil
  3. #+TITLE: tubo
  4. Tubo is a streaming front-end focused on bringing the [[https://newpipe.net/][NewPipe]] experience to the web. It aims at providing a clean and simple user interface to consume media from your favorite streaming platforms. It currently supports the same services as NewPipe, including YouTube, SoundCloud, Bandcamp, and more.
  5. * Features
  6. - No ads
  7. - Background player
  8. - Playback queue
  9. - User playlists
  10. - System/Light/Dark themes
  11. * Installation
  12. ** Packaging
  13. *** Docker
  14. For Docker, there's a Docker Compose file available which you can run like this:
  15. #+begin_src sh
  16. docker compose up -d
  17. #+end_src
  18. *** Uberjar
  19. To bundle the whole project into a self-contained uber-jar you need to follow these build steps:
  20. #+begin_src sh
  21. npm i
  22. clojure -T:cljs:build uberjar
  23. #+end_src
  24. After the last command is completed, you'll get a path to the uber-jar, which you can run like this:
  25. #+begin_src sh
  26. java -jar target/tubo-<VERSION>.jar
  27. #+end_src
  28. ** Reverse Proxy
  29. If you want to self-host Tubo and make it publicly accessible you'll need to set up a reverse proxy. The following shows some example configurations for various web servers:
  30. *** Nginx
  31. #+begin_src nginx
  32. server {
  33. listen 443 ssl http2;
  34. server_name <TUBO_HOST>;
  35. ssl_certificate /etc/letsencrypt/live/<TUBO_HOST>/fullchain.pem;
  36. ssl_certificate_key /etc/letsencrypt/live/<TUBO_HOST>/privkey.pem;
  37. location / {
  38. proxy_pass http://localhost:3000;
  39. proxy_set_header X-Forwarded-For $remote_addr;
  40. proxy_set_header HOST $http_host;
  41. }
  42. }
  43. #+end_src
  44. * Public Instances
  45. | URL | Country |
  46. |-------------------------------+---------|
  47. | https://tubo.media (Official) | 🇪🇸 |
  48. | https://tubo.reallyaweso.me | 🇩🇪 |
  49. | https://tubo.ducks.party | 🇩🇪 |
  50. * Development Setup
  51. To get a development environment set up, first install the front-end dependencies.
  52. #+begin_src sh
  53. npm i
  54. #+end_src
  55. ** CLI
  56. To start a front-end development server with hot-reload support, run:
  57. #+begin_src sh
  58. clojure -M:cljs watch tubo
  59. #+end_src
  60. You can now access it in your browser at [[http://localhost:8020]]
  61. To start the API, run:
  62. #+begin_src sh
  63. clojure -M:run
  64. #+end_src
  65. Note that front-end API requests will be proxied to the API.
  66. ** REPL
  67. You can also work on Tubo using an interactive environment like [[https://docs.cider.mx/cider/index.html][CIDER]]. Once you have it installed, do =M-x cider-jack-in-clj&cljs= in a source file and you'll enter a live REPL.
  68. If you'd like to automate the process, you can place something along the following lines in your =.dir-locals.el= file to automatically start the REPLs with the needed configuration.
  69. #+begin_src elisp
  70. ((nil . ((cider-preferred-build-tool . clojure-cli)
  71. (cider-clojure-cli-aliases . ":cljs")
  72. (cider-default-cljs-repl . custom)
  73. (cider-custom-cljs-repl-init-form . "(do (require '[shadow.cljs.devtools.api :as shadow])\n(require '[shadow.cljs.devtools.server :as server])\n(server/start!)\n(shadow/watch :tubo)\n(shadow/nrepl-select :tubo))")
  74. (cider-merge-sessions . :project)
  75. (eval . (progn
  76. (unless (boundp 'cider-jack-in-nrepl-middlewares)
  77. (require 'cider))
  78. (make-variable-buffer-local 'cider-jack-in-nrepl-middlewares)
  79. (add-to-list 'cider-jack-in-nrepl-middlewares "cider.nrepl/cider-middleware")
  80. (add-to-list 'cider-jack-in-nrepl-middlewares "shadow.cljs.devtools.server.nrepl/middleware"))))))
  81. #+end_src
  82. You can then invoke this to start the API:
  83. #+begin_src clojure
  84. user=> (require '[tubo.http])
  85. user=> (tubo.http/start-server!)
  86. #+end_src
  87. * Browser Extension Support
  88. ** [[https://einaregilsson.com/redirector/][Redirector]]
  89. You can manually add any redirect rule based on regex patterns with this extension. Below are some sample configurations to redirect links from supported services to Tubo so you get a basic idea of how to write manual Redirector rules. Note the =serviceId= of each service is: YouTube (0), SoundCloud(1), media.ccc.de(2), PeerTube(3), and Bandcamp(4).
  90. #+begin_src conf-colon
  91. Description: YouTube video to Tubo stream
  92. Example URL: https://www.youtube.com/watch?v=YE7VzlLtp-4
  93. Include pattern: ^((?:https?://)(?:www.)?youtube.com/(watch\?v.*|shorts/.*))
  94. Redirect to: https://<TUBO_HOST>/stream?url=$1
  95. Example result: https://<TUBO_HOST>/stream?url=https://www.youtube.com/watch?v=YE7VzlLtp-4
  96. Pattern type: Regular Expression
  97. Apply to: Main window (address bar)
  98. #+end_src
  99. #+begin_src conf-colon
  100. Description: SoundCloud stream to Tubo stream
  101. Example URL: https://soundcloud.com/unfa/stop-the-panic
  102. Include pattern: ^((?:https?://)(?:www.)?soundcloud.com/.*/.*)
  103. Redirect to: https://<TUBO_HOST>/stream?url=$1
  104. Example result: https://<TUBO_HOST>/stream?url=https://soundcloud.com/unfa/stop-the-panic
  105. Pattern type: Regular Expression
  106. Apply to: Main window (address bar)
  107. #+end_src
  108. #+begin_src conf-colon
  109. Description: Bandcamp album to Tubo playlist
  110. Example URL: https://unfa.bandcamp.com/album/suppressed
  111. Include pattern: ^((?:https?://)(.*\.)?bandcamp.com/album/.*)
  112. Redirect to: https://<TUBO_HOST>/playlist?url=$1
  113. Example result: https://<TUBO_HOST>/playlist?url=https://unfa.bandcamp.com/album/suppressed
  114. Pattern type: Regular Expression
  115. Apply to: Main window (address bar)
  116. #+end_src
  117. #+begin_src conf-colon
  118. Description: PeerTube (Framatube) channel to Tubo channel
  119. Example URL: https://framatube.org/accounts/framasoft@framatube.org
  120. Include pattern: ^((?:https?://)(?:www.)?framatube.org/accounts/.*)
  121. Redirect to: https://<TUBO_HOST>/channel?url=$1
  122. Example result: https://<TUBO_HOST>/channel?url=https://framatube.org/accounts/framasoft@framatube.org
  123. Pattern type: Regular Expression
  124. Apply to: Main window (address bar)
  125. #+end_src
  126. #+begin_src conf-colon
  127. Description: media.ccc.de search query to Tubo search query
  128. Example URL: https://media.ccc.de/search/?q=37c3
  129. Include pattern: ^(?:https?://)media.ccc.de/search/\?q=(.*)
  130. Redirect to: https://<TUBO_HOST>/search?query=$1&serviceId=2
  131. Example result: https://<TUBO_HOST>/search?query=37c3&serviceId=2
  132. Pattern type: Regular Expression
  133. Apply to: Main window (address bar)
  134. #+end_src
  135. ** [[https://libredirect.github.io/][LibRedirect]]
  136. Redirects many popular services to their alternative front-ends. Has a ton of features and an active community. Tubo is supported by default for YouTube and SoundCloud.
  137. ** [[https://github.com/libreom/predirect][Predirect]]
  138. Serves the same purpose as LibRedirect but is Manifest V3 compatible. Tubo is supported by default for SoundCloud.
  139. ** [[https://github.com/dybdeskarphet/privacy-redirector][Privacy Redirector]]
  140. A user-script that redirects popular social media platforms to their privacy respecting front-ends. Tubo is supported by default for YouTube and SoundCloud.