Commit Graph

56 Commits

Author SHA1 Message Date
diogo
7eba7fbcc7 add index to playlist item 2021-10-11 23:30:49 +02:00
mastihios
0947c26612 Fix URL-encoding in href strings (#2460)
* hrefs: replace HTML.escape w/ URI.encode_www_form

* Fix search_query_encoded
2021-10-11 05:18:20 -07:00
syeopite
9c44e41a4c Merge pull request #2228 from syeopite/extract-items-overhaul
Overhaul extract_item(s) functions and add infrastructure for parsing YouTube categories
2021-10-02 20:00:16 +00:00
mastihios
7b2aa5f98e add icon-buttons to playlist items (#2442) 2021-10-02 11:59:33 +00:00
syeopite
a50f64f6e9 Add parser for categories (shelfRenderer)
This commit adds a new parser for YT's shelfRenderers which are
typically used to denote different categories.The code for featured
channels parsing has also been moved to use the new parser but some
additional refactoring are needed there.

The ContinuationExtractor has also been improved and is now capable of
extraction continuation data that is packaged under
"appendContinuationItemsAction"

In additional this commit adds some useful helper functions to extract
the current selected tab the continuation token. This is to mainly
reduce code size and repetition.
--
This cherry-picked commit also removes the code for parsing featured
channels present on the original.

(cherry picked from commit 8000d538dbbf1eb9c78e000b1449926ba3b24da9)
2021-09-24 21:07:06 -07: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
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
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
syeopite
173cd7c15e Fix switch invidious instance btn on videos 2021-06-19 04:16:18 -07:00
syeopite
f178297452 Generalize redirect route 2021-06-19 04:16:18 -07:00
syeopite
37ff2ac2b9 Overhaul button icon html and styling 2021-06-19 04:16:18 -07:00
syeopite
4786d586cf Add new icon button for instance redirects 2021-06-19 04:16:17 -07:00
syeopite
148071a744 Add 'www' to URL on watch on youtube button 2021-03-25 11:24:02 -07:00
syeopite
56fab9d178 Add watch on youtube button on each video item 2021-03-24 18:34:06 -07:00
syeopite
f422a77014 Add translation to Audio Mode icon on vid result 2021-03-24 18:07:18 -07:00
Andrew Zhao
148f3002ec use large thumbnail for channels in search 2021-02-04 18:20:49 -05:00
saltycrys
5f03a583d1 Update code for Crystal 0.36.0
Rename `HTTPClient@socket` to `HTTPClient@io`, see
https://github.com/crystal-lang/crystal/pull/9543.

Rename `URI#full_path` to `URI#request_target`, see
https://github.com/crystal-lang/crystal/pull/10099.
2021-02-02 20:01:02 +01:00
Perflyst
bb7d8735cb Merge branch 'master' into patch-1 2020-11-12 17:06:38 +01:00
Omar Roth
1eca969cf6 Add support for polymer redesign 2020-06-15 18:18:04 -05:00
leonklingele
70cbe91776 Migrate to a good Content Security Policy (#1023)
So attacks such as XSS (see [0]) will no longer be of an issue.

[0]: https://github.com/omarroth/invidious/issues/1022
2020-03-15 16:46:08 -05:00
Omar Roth
9dc4f8a1aa Escape item titles in search page 2020-03-04 13:03:14 -05:00
Alexander Pushkov
1fc9506442 Add audio mode link to items 2020-01-21 15:36:56 +03:00
Omar Roth
be055d9dcb Add support for custom playlists 2019-10-15 21:17:14 -04:00
leonklingele
1aefc5b540 Update to Crystal 0.31.0, resolve compiler deprecation warnings, update dependencies (#764)
* shard: update to crystal 0.31.0

Additionally, no longer use the Crystal "markdown" library which has
been removed from the Crystal stdlib in version 0.31.0.
See https://github.com/crystal-lang/crystal/pull/8115.

Also fix some deprecation warnings using the following commands:

    find . \( -type d -name .git -prune \) -o -type f -exec sed -i 's/URI\.escape/URI\.encode_www_form/g' "{}" \;
    find . \( -type d -name .git -prune \) -o -type f -exec sed -i 's/URI\.unescape/URI\.decode_www_form/g' "{}" \;
    sed -i 's/while \%pull\.kind \!\= \:end_object/until \%pull\.kind\.end_object\?/g' src/invidious/helpers/patch_mapping.cr
2019-09-24 13:31:33 -04:00
Omar Roth
50d793e49b Hide video count for auto-generated channels 2019-09-12 13:11:21 -04:00
Omar Roth
a19cdb5e72 Fix season playlists 2019-08-16 15:46:59 -05:00
Omar Roth
12b2ab5da8 Add 'to_json' into respective structs 2019-06-08 13:31:41 -05:00
Omar Roth
2febc268f7 Fix warnings in Crystal 0.29 2019-06-07 21:13:50 -05:00
Omar Roth
8c944815bc Minor refactor 2019-06-07 21:13:50 -05:00
Omar Roth
64464f23ae Add 'views' to channel_videos 2019-05-30 18:59:13 -05:00
Omar Roth
7d2e1f63b5 Refactor watched_widget.js 2019-05-16 20:51:17 -05:00
Omar Roth
570715100b Fix text size for premieres 2019-05-03 18:00:16 -05:00
Omar Roth
1a9360ca75 Minor formatting changes 2019-05-01 20:03:39 -05:00
Omar Roth
f08d53b0c6 Add view count to livestreams in search results 2019-04-28 14:11:23 -05:00
Omar Roth
2a6c81a89d Add authentication API 2019-04-18 16:23:50 -05:00
Omar Roth
26168a9520 Refactor CSRF tokens (using format in #473) 2019-04-15 23:23:40 -05:00
Omar Roth
b51fd7fc13 Add view count to video items 2019-04-14 17:43:44 -05:00
Omar Roth
7a0f0ca5ce Fix thin mode 2019-03-27 11:31:05 -05:00
Omar Roth
fd26f9f34e Add support for premieres to search and feed 2019-03-22 14:54:35 -05:00
Omar Roth
88b70973cc Add 'premiereTimestamp' to /api/v1/videos 2019-03-22 14:53:19 -05:00
Omar Roth
99aa214859 Add 'thumbnail_id' to playlists 2019-03-17 12:21:47 -05:00
Omar Roth
7e6cf7b979 Add title text for icons 2019-02-24 16:19:31 -06:00
Omar Roth
5bf3c28436 Add better indicator for livestreams 2019-02-21 14:19:05 -06:00
Omar Roth
83493237a5 Add support for translating time intervals 2019-02-20 08:49:54 -06:00
Omar Roth
a160c645c9 Add support for translations 2018-12-20 15:32:09 -06:00
Omar Roth
d6d73bd336 Fix clickable titles in subscription feed 2018-11-20 22:58:30 -06:00
Omar Roth
6b12f11e10 Add ability to mark videos as watched in subscription feed 2018-11-19 22:06:59 -06:00
Omar Roth
b535de690e Move video count into playlist thumbnail 2018-11-19 17:34:33 -06:00
Omar Roth
c8b321920d Add channel video count to search results 2018-11-13 19:18:08 -06:00
Omar Roth
316a73f07e Remove duration for playlists in search results 2018-11-07 10:07:47 -06:00