README 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. *** Uberjar
  14. To bundle the whole project into a self-contained uber-jar you need to follow these build steps:
  15. #+begin_src sh
  16. npm i
  17. clojure -T:frontend:build uberjar
  18. #+end_src
  19. After the last command is completed, you'll get a path to the uber-jar, which you can run like this:
  20. #+begin_src sh
  21. java -jar target/tubo-<VERSION>.jar
  22. #+end_src
  23. *** Docker
  24. For Docker, there's an image available in Docker Hub you can use:
  25. #+begin_src sh
  26. docker pull migalmoreno/tubo
  27. docker run --publish 3000:3000 -d --name tubo migalmoreno/tubo:latest
  28. #+end_src
  29. There's also a Docker Compose file available which you can run like this:
  30. #+begin_src sh
  31. docker compose up -d
  32. #+end_src
  33. ** Reverse Proxy
  34. 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:
  35. *** Nginx
  36. #+begin_src nginx
  37. server {
  38. listen 443 ssl http2;
  39. server_name <TUBO_HOST>;
  40. ssl_certificate /etc/letsencrypt/live/<TUBO_HOST>/fullchain.pem;
  41. ssl_certificate_key /etc/letsencrypt/live/<TUBO_HOST>/privkey.pem;
  42. location / {
  43. proxy_pass http://localhost:3000;
  44. proxy_set_header X-Forwarded-For $remote_addr;
  45. proxy_set_header HOST $http_host;
  46. }
  47. }
  48. #+end_src
  49. * Development setup
  50. To get a development environment set up, first install the front-end dependencies.
  51. #+begin_src sh
  52. npm i
  53. #+end_src
  54. Then, compile ahead-of-time (AOT) the necessary classes.
  55. #+begin_src sh
  56. clojure -M -e "(compile 'tubo.downloader-impl)"
  57. #+end_src
  58. ** CLI
  59. To start a front-end development server with hot-reload support, run:
  60. #+begin_src sh
  61. clojure -M:frontend watch tubo
  62. #+end_src
  63. You can now access it in your browser at [[http://localhost:8020]]
  64. To start the API, run:
  65. #+begin_src sh
  66. clojure -M:run
  67. #+end_src
  68. Note that front-end API requests will be proxied to the API.
  69. ** REPL
  70. 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.
  71. 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.
  72. #+begin_src elisp
  73. ((nil . ((cider-preferred-build-tool . clojure-cli)
  74. (cider-clojure-cli-aliases . "-M:frontend")
  75. (cider-default-cljs-repl . custom)
  76. (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))")
  77. (cider-merge-sessions . :project)
  78. (eval . (progn
  79. (unless (boundp 'cider-jack-in-nrepl-middlewares)
  80. (require 'cider))
  81. (make-variable-buffer-local 'cider-jack-in-nrepl-middlewares)
  82. (add-to-list 'cider-jack-in-nrepl-middlewares "cider.nrepl/cider-middleware")
  83. (add-to-list 'cider-jack-in-nrepl-middlewares "shadow.cljs.devtools.server.nrepl/middleware"))))))
  84. #+end_src
  85. You can then invoke this to start the API:
  86. #+begin_src clojure
  87. user=> (require '[tubo.http])
  88. user=> (tubo.http/start-server!)
  89. #+end_src
  90. * Public Instances
  91. | URL | Country |
  92. |-------------------------------+---------|
  93. | https://tubo.media (Official) | 🇪🇸 |
  94. | https://tubo.reallyaweso.me | 🇩🇪 |
  95. | https://tubo.ducks.party | 🇩🇪 |
  96. * Browser Extension Support
  97. ** [[https://einaregilsson.com/redirector/][Redirector]]
  98. 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).
  99. #+begin_src conf-colon
  100. Description: YouTube video to Tubo stream
  101. Example URL: https://www.youtube.com/watch?v=YE7VzlLtp-4
  102. Include pattern: ^((?:https?://)(?:www.)?youtube.com/(watch\?v.*|shorts/.*))
  103. Redirect to: https://<TUBO_HOST>/stream?url=$1
  104. Example result: https://<TUBO_HOST>/stream?url=https://www.youtube.com/watch?v=YE7VzlLtp-4
  105. Pattern type: Regular Expression
  106. Apply to: Main window (address bar)
  107. #+end_src
  108. #+begin_src conf-colon
  109. Description: SoundCloud stream to Tubo stream
  110. Example URL: https://soundcloud.com/unfa/stop-the-panic
  111. Include pattern: ^((?:https?://)(?:www.)?soundcloud.com/.*/.*)
  112. Redirect to: https://<TUBO_HOST>/stream?url=$1
  113. Example result: https://<TUBO_HOST>/stream?url=https://soundcloud.com/unfa/stop-the-panic
  114. Pattern type: Regular Expression
  115. Apply to: Main window (address bar)
  116. #+end_src
  117. #+begin_src conf-colon
  118. Description: Bandcamp album to Tubo playlist
  119. Example URL: https://unfa.bandcamp.com/album/suppressed
  120. Include pattern: ^((?:https?://)(.*\.)?bandcamp.com/album/.*)
  121. Redirect to: https://<TUBO_HOST>/playlist?url=$1
  122. Example result: https://<TUBO_HOST>/playlist?url=https://unfa.bandcamp.com/album/suppressed
  123. Pattern type: Regular Expression
  124. Apply to: Main window (address bar)
  125. #+end_src
  126. #+begin_src conf-colon
  127. Description: PeerTube (Framatube) channel to Tubo channel
  128. Example URL: https://framatube.org/accounts/framasoft@framatube.org
  129. Include pattern: ^((?:https?://)(?:www.)?framatube.org/accounts/.*)
  130. Redirect to: https://<TUBO_HOST>/channel?url=$1
  131. Example result: https://<TUBO_HOST>/channel?url=https://framatube.org/accounts/framasoft@framatube.org
  132. Pattern type: Regular Expression
  133. Apply to: Main window (address bar)
  134. #+end_src
  135. #+begin_src conf-colon
  136. Description: media.ccc.de search query to Tubo search query
  137. Example URL: https://media.ccc.de/search/?q=37c3
  138. Include pattern: ^(?:https?://)media.ccc.de/search/\?q=(.*)
  139. Redirect to: https://<TUBO_HOST>/search?query=$1&serviceId=2
  140. Example result: https://<TUBO_HOST>/search?query=37c3&serviceId=2
  141. Pattern type: Regular Expression
  142. Apply to: Main window (address bar)
  143. #+end_src
  144. ** [[https://libredirect.github.io/][LibRedirect]]
  145. 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.
  146. ** [[https://github.com/libreom/predirect][Predirect]]
  147. Serves the same purpose as LibRedirect but is Manifest V3 compatible. Tubo is supported by default for SoundCloud.
  148. ** [[https://github.com/dybdeskarphet/privacy-redirector][Privacy Redirector]]
  149. A user-script that redirects popular social media platforms to their privacy respecting front-ends. Tubo is supported by default for YouTube and SoundCloud.