Commit Graph
100 Commits
Author SHA1 Message Date
Samantaz Fox 05f9613e14 Merge pull request #2623 from SamantazFox/temp-decompression-fix
Temporarily fix for #2612
2021-11-28 02:35:39 +01:00
Samantaz Fox 6876f88f43 Merge pull request #2622 from SamantazFox/add-makefile
Add a makefile
2021-11-26 20:28:03 +01:00
Samantaz Fox ad9d3f4425 Merge pull request #2555 from iv-org/readme-enhancements
Enhance some stuff in the README
2021-11-26 20:24:31 +01:00
Samantaz Fox ba48f68fc3 allow multiple, successive content-encodings 2021-11-21 18:16:05 +01:00
Samantaz Fox 008f79df61 Merge pull request #2630 from babababag/patch-1
Escape video description in <meta> elements
2021-11-17 13:22:54 +01:00
Samantaz Fox e0d26f4055 Merge pull request #2625 from weblate/weblate-invidious-translations
Translations update from Hosted Weblate
2021-11-16 23:32:52 +01:00
Samantaz Fox 2c447a42f2 Make sure to only apply fix if QUIC is disabled 2021-11-16 21:40:35 +01:00
Samantaz Fox dad8f9a0ce Fix typo
Should be checking the returned headers, not the sent ones.
2021-11-16 20:39:26 +01:00
Samantaz Fox 2eac23a0b3 Temporary fix for #2612
Don't rely on the auto compression/decompression provided by the crystal stdlib.
2021-11-16 13:46:28 +01:00
Samantaz Fox 6a204753c0 Fix typo 2021-11-15 23:36:52 +01:00
Samantaz Fox 19bb26a789 Add a makefile 2021-11-15 23:08:48 +01:00
Samantaz Fox 00904ae3f2 Merge pull request #2444 from syeopite/only-use-redirect-endpoint-when-needed
Only use the /redirect endpoint when automatically redirecting to another instance
2021-11-13 20:40:09 +01:00
Samantaz Fox 4940759627 Example config: Change 'use_quic' default value
Related to commit a120f143d7
Also point towards the Github issue.
2021-11-12 18:53:51 +01:00
Samantaz Fox a12571e748 Fix minor error in config.example.yml
Update the "note" for `locale`
2021-11-12 02:32:15 +01:00
Samantaz Fox 6cabc96f75 Merge pull request #2471 from SamantazFox/extractor-patch-2
Fix infinite recursion caused by `to_json` methods in different data structures
2021-11-07 21:32:02 +01:00
Samantaz Fox afb284fa9b Add "preferences_quality_dash_label" to en_US.json
This key never existed before and #2524 just made it obvious.
2021-11-01 15:48:05 +01:00
Samantaz Fox 6cf0ff6b49 Remove useless auto_generated param from PlaylistVideo#to_xml
given the variables available in this function's context, 'author' and 'ucid'
provide the same data 'self.author' and 'self.ucid', respectively.

Given that fact, the variable `auto_generated` has no impact on the logic of
this function, and hence can be safely removed. this greatly simplifies the
code and makes it perfectly compatible with crystal's calling convention for
'#to_xml' methods.
2021-10-29 16:26:42 +02:00
Samantaz Fox 86f75758a7 Fix 'to_json' in struct PlaylistVideo 2021-10-29 16:26:42 +02:00
Samantaz Fox 0ec94405ce Add TODO comments to other places 2021-10-29 16:26:42 +02:00
Samantaz Fox 33780f1995 Also fix 'to_json' in struct Video 2021-10-29 16:26:35 +02:00
Samantaz Fox 1cb715ac9f serialized_yt_data: force datatype of 'locale' 2021-10-28 17:48:08 +02:00
Samantaz Fox f65b628bf3 serialized_yt_data: Remove default nil value in to_json
this will ensure that two parameters are passed and that it
doesn't collide with 'to_json(builder)'
2021-10-28 17:48:07 +02:00
Samantaz Fox 60fa552469 Fix an infinite recursion caused by #2228
Changes in the aforementioned PR lead to change the behavior
of some old code.

The data type of the parameters aren't explicit enough, which
makes the compiler use the wrong method because of type infering.
2021-10-28 17:48:07 +02:00
Samantaz Fox 2b81a82620 Merge pull request #2529 from DmitrySandalov/master
Feature Request: Localization for trending iv-org#331
2021-10-26 23:49:56 +02:00
Samantaz Fox b555df8377 Merge pull request #2428 from syeopite/ameba-fixes
Fix (some) issues detected by Ameba
2021-10-26 23:34:18 +02:00
Samantaz Fox 232730e909 Merge branch 'master' into master 2021-10-26 23:31:48 +02:00
Samantaz Fox 2c1b4b0dd8 Merge pull request #2524 from SamantazFox/preferences-locales-rework
Preferences locales key normalization
2021-10-26 23:23:29 +02:00
Samantaz Fox 1e0712625a Normalize translation key for preferences categories
categories normalized:
 - Miscellanous
 - Player
 - Visual
 - Administrator
 - Data
 - Subscription
2021-10-26 23:17:04 +02:00
Samantaz Fox 88752f32bd Normalize translation key for user prefrerences
preferences normalized:
 - annotations
 - annotations_subscribed
 - automatic_instance_redirect
 - autoplay
 - captions
 - comments
 - continue
 - continue_autoplay
 - dark_mode
 - default_home
 - extend_desc
 - feed_menu
 - listen
 - local
 - locale
 - max_results
 - notifications_only
 - player_style
 - quality
 - quality_dash
 - related_videos
 - show_nick
 - sort
 - speed
 - thin_mode
 - unseen_only
 - video_loop
 - volume
 - vr_mode
2021-10-26 23:15:39 +02:00
Samantaz Fox 7a93d4c7e4 Merge pull request #2523 from weblate/weblate-invidious-translations
Translations update from Weblate
2021-10-26 21:10:07 +02:00
Samantaz Fox 5eb83bb39c Bump crystal version for ARM docker container to 1.2.0-r0 (#2527) 2021-10-24 19:26:53 +00:00
Samantaz Fox cb9b84f940 Move 'extract_text()' to 'extractors_utils.cr' 2021-10-18 16:14:37 +02:00
Samantaz Fox 33d9be0ffb Move 'extractors.cr' to 'yt_backend' folder 2021-10-18 16:12:49 +02:00
Samantaz Fox 2571e420f3 Move 'add_yt_headers()' to 'connection_pool.cr' 2021-10-18 16:12:18 +02:00
Samantaz Fox e17c8b1f4d Move 'extract_videos' and 'extract_selected_tab' too 2021-10-18 16:12:18 +02:00
Samantaz Fox 8805ee7c8c Add fetch_continuation_token back (required by #2215) 2021-10-18 16:12:18 +02:00
Samantaz Fox 7df2fd0bc8 Add 'require' statement to 'invidious.cr' 2021-10-18 16:12:17 +02:00
Samantaz Fox f7f0910953 Remove fetch_continuation_token(): dead code 2021-10-18 16:12:17 +02:00
Samantaz Fox d300797e22 Move the YoutubeConnectionPool code to its own file 2021-10-18 16:12:17 +02:00
Samantaz Fox 56dbe15943 Move proxy & YoutubeAPI code to the yt_backend folder 2021-10-18 16:12:17 +02:00
Samantaz Fox dfe0c738d6 Fix in README: license is AGPLv3, not AGPLv3+ 2021-10-17 15:53:01 +02:00
Samantaz Fox 39c27f0c66 Merge pull request #2257 from diogorac/fix-only-second-vid 2021-10-11 23:55:09 +02:00
Samantaz Fox 678b10dbcf Lookback 50 videos 2021-10-11 23:52:57 +02:00
Samantaz Fox e3054ccdd2 Fix Role "kemal" does not exist (#2490) 2021-10-11 19:34:25 +00:00
Samantaz Fox 7661c3c061 Remove useless 'require' statement in spec 2021-10-11 18:33:36 +02:00
Samantaz Fox 57ed047025 Add mising 'require' statement to 'invidious.cr' 2021-10-11 18:33:36 +02:00
Samantaz Fox bda3a26423 Move server structure to a separate file 2021-10-11 18:33:36 +02:00
Samantaz Fox 080d9a8dc7 move theme converter function to a separate file 2021-10-11 18:33:36 +02:00
Samantaz Fox 984a4acc7b Move user preferences structure to a separate file 2021-10-11 18:33:36 +02:00
Samantaz Fox c6f088d6ca Reduce refresh delay, increase backoff start duration 2021-10-08 18:39:02 +02:00
Samantaz Fox f85930700b Add myself (SamantazFox) as codeowner of locale files (#2472) 2021-10-07 06:01:25 -07:00
Samantaz Fox adc12addfa Add config option to display source code URL in footer (#2450) 2021-10-07 13:53:12 +02:00
Samantaz Fox d806310665 Revert "Fix typo (#2456)" (#2457)
This reverts commit 4982bff74d.
2021-10-04 19:51:57 +02:00
Samantaz Fox 5a52b4fe45 Fix lint 2021-10-02 17:41:25 +02:00
Samantaz Fox caa08a6379 Disable locales with less than 50% of strings translated 2021-10-02 17:38:06 +02:00
Samantaz Fox cd02078e26 Add Portuguese (pt) to locales
follow up to #2437
2021-10-02 17:19:28 +02:00
Samantaz Fox 9ba3e1cdb4 Decrease channel refresh frequency (1 min -> 1 h)
This is a temporary fix to reduce load on instances with many channels and avoid IP being flagged by Google.
2021-09-26 23:31:14 +02:00
Samantaz Fox e655af251c Try not to log search queries (#2362) 2021-09-16 09:36:22 +00:00
Samantaz Fox 947fe4fbb3 HTML escape video mimetype
Video mimetype may contain code information between double quotes.
If not properly escaped, it breaks the browser's parser. E.g:
```
type="video/mp4; codecs=" avc1.64001f,="" mp4a.40.2""=""
```

Thank Robin for catching this!
2021-09-13 18:20:11 +02:00
Samantaz Fox 0aae728e33 Fix "fatal role postgres doesn't exist" (#2296)
* Fix "fatal role postgres doesn't exist" 

Fix a frequent error with recent postgres docker images:
`FATAL:  role "postgres" does not exist`

* Use $$VAR so it's expanded by the shell, not docker
2021-08-12 19:55:10 +00:00
Samantaz Fox 4b46313e19 Fix crystal overrides (#2295)
* Move Crystal stdlib classes overrides to a separate file
* Document known crystal overrides
* Update crystal overrides for HTTP::Client socket
* Update shard.yml to restrict crystal versions
* Fix compilation error in Crystal 1.1.x (See
   https://github.com/crystal-lang/crystal/issues/10965
   for more details about this issue).
2021-08-03 23:44:47 +02:00
Samantaz Fox 5b020e81ca Youtube api improvements (#2277)
* Put youtube API functions under the YoutubeAPI namespace

* Implement the following endpoints:
  - `next`
  - `player`
  - `resolve_url`

* Allow a ClientConfig to be passed to YoutubeAPI endpoint handlers.

* Add constants for many new clients

* Fix documentation of YoutubeAPI.browse(): Comments and search
  result aren't returned by the browse() endpoint but by the next()
  and search() endpoints, respectively.

* Accept gzip compressed data, to help save on bandwidth

* Add debug/trace logging

* Other minor fixes
2021-08-03 02:58:27 +02:00
Samantaz Fox 84594b0e1e Remove workaround for decompression of proxied files (#2286)
Was used by `proxy_file` before crystal 0.35.0.
Implemented in: f7dbf2bdd4
orphaned since: d30a972a90
2021-07-28 17:15:51 -07:00
Samantaz Fox bc937a6434 Add Korean (ko.json) to loaded locales
Required because of c83113d49b.
2021-07-26 00:15:32 +02:00
Samantaz Fox 3a84e3abcf Remove locales consistency check
This is not required anymore, due to the new weblate config (from now
on, weblate adds strings as they are translated).
2021-07-26 00:12:43 +02:00
Samantaz Fox e4c223ca59 Merge pull request #2266 from weblate/weblate-invidious-translations
Translations update from Weblate
2021-07-26 00:09:30 +02:00
Samantaz Fox 1ee4cae802 Rework the README (#2135)
Major README.md cleaning

Additions:
* Add the invidious logo
* Add Quickstart section
* Add relevant links (instance list, documentation, contribute, donate) directly in the header

Badges:
* Add badges for open issues and PRs
* Add "Awesome Humane Tech" badge, as we're listed there
* Move CI passed/translated badges to the top
* Replace the "license feature" with a proper badge

Major section changes:
* Reword titles
* Rewrite features list
* Promote the screenshots sections. People like screenshots!
* Move "donate" to the end, there is a link at the top anyway
* Move section "made with invidious" after all the other invidious related sections + rename it to "Projects using Invidious"

Other fixes:
* Remove useless HTML in the screenshots table
* Remove extra columns in H2 titles
* Remove all useless lines between sections
* Use markdown for git commands + add the staging step
* Promote invidious redirect in "Extensions"
* Update preference screenshots
2021-07-24 20:48:30 +02:00
Samantaz Fox 9f5f5da894 config_example.yaml: document all possible options (#2083)
Fixes https://github.com/iv-org/documentation/issues/46
2021-07-16 20:34:40 +02:00
Samantaz Fox 56ebef4352 Multiple front-end fixes (#2247)
Fixes:
* Sanitize user-provided content in HTML (Fixes #2193)
* Fix encoding of search query in prev/next pages (Fixes #2229)
* Fix some issues introduced with #2196:
   - Fix alignment of all <h3> elements (Move the inline style from the parent to the <h3> element)
   - Add missing comma on 'dir' HTML attribute (Typo introduced by PR #2196)

Code cleaning:
* Remove unnecessary 'each_sclice' + 'each' double loop in ECR files
* Clean the player's <source> list generation code (in player.ecr)
2021-07-15 23:01:36 +02:00
Samantaz Fox b633f8d207 More locales fixes for consistency checks 2021-07-12 21:58:38 +02:00
Samantaz Fox c4c813fd0a Fix da.json for consistency checks 2021-07-12 20:45:26 +02:00
Samantaz Fox f9c4cc274a Fix sr.json for consistency checks 2021-07-12 20:37:51 +02:00
Samantaz Fox cc45a0ca28 Fix cs.json for consistency checks 2021-07-12 20:34:10 +02:00
Samantaz Fox 9ed1d28f76 Fix sk.json for consistency checks 2021-07-12 20:30:50 +02:00
Samantaz Fox 7ca2acd24e Fix si.json for consistency checks 2021-07-12 20:19:09 +02:00
Samantaz Fox fdca468049 Update bn_BD.json to pass consistency checks 2021-07-12 20:05:10 +02:00
Samantaz Fox c0e8feb66e Add new and missing locales to i18n.cr
New locales: lt, vi
Missing: bn_BD, cs, da, eu, hu-HU, si, sk, sr, sr_Cyrl
2021-07-12 19:41:35 +02:00
Samantaz Fox fd313f0d66 Fix alignment of "invidious" logo on search page
The alignment was broken by #2196
2021-06-29 23:18:17 +02:00
Samantaz Fox 67a18dcff6 Merge pull request #2196 from ahangarha/patch-1
Add bi-directional text support
2021-06-27 22:39:45 +02:00
Samantaz Fox cfcb64c516 Fix layout of video 'card' items
Previous changes broke alignment of text and icons
2021-06-25 20:47:15 +02:00
Samantaz Fox 135ae11c20 Merge pull request #2195 from B0pol/trending
Use youtubei API for trending
2021-06-25 17:53:07 +02:00
Samantaz Fox eecfc155b8 Right-align the RSS icon in channel playlists 2021-06-25 02:15:49 +02:00
Samantaz Fox 9cef7945c0 Fix RTL text in video titles on Firefox
The behavior was as follow: on Right-To-Left text (e.g Arabic) that is wrapped
(because it's too long to fit on one line), the second row and following rows
may or may not be right aligned (as RTL text should be). Opening the devtools
fixes that alignement, as consistently as closing the devtool breaks it.

This problem seems to arrive only in the following configurations (link nested
in a paragraph, both of which may or may not have the dir= attribute):

* `<p><a href="some_link">RTL_TEXT</a></p>`
* `<p><a href="some_link" dir="auto">RTL_TEXT</a></p>`
* `<p dir="auto"><a href="some_link">RTL_TEXT</a></p>`

with the following CSS:

```
p {
	unicode-bidi: plaintext;
	text-align: start;
}
```

Changing the HTML to the following configuration (a paragraph with the dir=
attribute, nested in a link) seems to fix it:

`<a href="some_link"><p dir="auto">RTL_TEXT</p></a>`
2021-06-25 02:03:09 +02:00
Samantaz Fox 9e4fd193c6 Limit descriptions width to ease mixed LTR/RTL text reading
This will prevent, on large pages, the LTR and RTL text to be
far away, on each side of the page. This could happen on channel
and playlists descriptions, when the page is displayed on a large
screen.
2021-06-24 17:35:44 +04:30
Samantaz Fox 5a8825d016 Fix quoting of 'none' in CSP header
The keyword 'none' must be surrounded by single quotes.
Regression introduced by #2168.
2021-06-20 18:43:00 +02:00
Samantaz Fox 42d9fd9c88 Rewrite response headers
Fixes #2018 and #2153
2021-06-17 19:53:39 +02:00
Samantaz Fox 3de92b337d Use if/else instead of return in search route 2021-06-14 17:27:47 +02:00
Samantaz Fox a2f5342a83 Multiple search fixes
* Remove percent-encoding of the search query when calling youtube API, as it
  breaks UTF-8
* Empty search redirects to /search, not /
* Show the fullscreen search "home page" (from #1977) at /search
* Allow 'region=' parameter to be passed to /search
* Other minor fixes
2021-06-13 21:52:36 +02:00
Samantaz Fox 9407b91060 Fix typo in hu-HU translation
Change requested by the original translator, see https://github.com/iv-org/invidious/pull/2141#pullrequestreview-679868487
2021-06-10 17:22:20 +02:00
Samantaz Fox b7fe212a18 Fix youtube API function's documentation 2021-05-24 15:25:00 +02:00
Samantaz Fox cbabf0ae7e Craft the "context" data in a dedicated function
As the amount of API endpoint function grow, this will
prevent ugly code copy/pasta
2021-05-24 13:44:49 +02:00
Samantaz Fox 344ccf3b03 Use '/youtubei/v1/browse' endpoint for playlists 2021-05-24 13:19:28 +02:00
Samantaz Fox 26a7e1b049 Use '/youtubei/v1/search' endpoint for search queries 2021-05-24 13:19:28 +02:00
Samantaz Fox 43bd331e48 Multiple youtube_api.cr helper fixes
Add documentation
Bump web client version string
Add charset=UTF-8 to the 'content-type' header
Parse JSON and return it as a Hash
Handle API error messages
2021-05-24 13:19:28 +02:00
Samantaz Fox 2c47ef31c0 Add newline at end of file for 'el' and 'zh-TW' 2021-04-21 16:22:20 +02:00
Samantaz Fox d69b9f9cf8 Minor fixes in locales after synchronization 2021-04-21 16:11:39 +02:00
Samantaz Fox a52e9be3e8 Add missing fields to locales (part 6)
Updated da.json     (Danish)
Updated de.json     (German)
Updated eo.json     (Esperando)
Updated es.json     (Spanigh)
Updated nb-NO.json  (Norvegian)
Updated nl.json     (Dutch)
Updated pl.json     (Polish)
Updated pt-BR.json  (Portuguese, Brasil)
Updated ro.json     (Romanian)
Updated ru.json     (Russian)
Updated sv-SE.json  (Swedish)
Updated uk.json     (Ukrainian)
Updated zh-CN.json  (Chinese, China)
2021-04-21 16:11:00 +02:00
Samantaz Fox 21f9141500 Add missing fields to locales (part 5)
* Also includes minor fixes when I could (french, italian, icelandic)
* Added a new line at the end of en-US translation.

Updated ar.json     (Arabic)
Updated el.json     (Greek)
Updated fa.json     (Persian)
Updated fr.json     (French)
Updated is.json     (Icelandic)
Updated it.json     (Italian)
Updated tr.json     (Turkish)
Updated zh-TW.json  (Chinese, Taiwan)
2021-04-21 16:11:00 +02:00
Samantaz Fox 0e000e44aa Make the linter happy, again 2021-04-21 16:10:25 +02:00
Samantaz Fox ad9fe3be09 Add missing fields to locales (part 4)
Updated el.json     (Greek)
Updated fa.json     (Persian)
Updated fi.json     (Finnish)
Updated it.json     (Italian)
Updated pt-PT.json  (Portuguese, Portugal)
Updated zh-TW.json  (Chinese, Taiwan)
2021-04-21 16:10:25 +02:00