Commit Graph
100 Commits
Author SHA1 Message Date
syeopite 9ab242ca2e Optimize routing logic of extract_item(s) funcs 2021-09-28 08:50:23 -07:00
syeopite aa59925374 Rename get_browse_endpoint to get_browse_id 2021-09-28 08:39:00 -07:00
syeopite 43ea8fa706 Convert nil for AuthorFallback to empty strings 2021-09-28 08:25:03 -07:00
syeopite 092b8a4e52 Add documentation to extractors.cr 2021-09-24 21:07:07 -07:00
syeopite e5f07dedbf Typos and tiny styling changes 2021-09-24 21:07:07 -07:00
syeopite ca9eb0d539 Bountiful extractor changes
- Add extract_text to simplify extraction of InnerTube texts
- Add helper extractor methods to reduce repetition in parsing InnerTube
- Change [] more than 2 blocks long to use #dig or #dig?
- Remove useless ?.try blocks for items that always exists
- Add (some) documentation to VideoRendererParser
2021-09-24 21:07:07 -07:00
syeopite 142317c2be Overhaul extractors.cr to use modules 2021-09-24 21:07:07 -07:00
syeopite 3dea670091 Switch to structs in extractors.cr for performance 2021-09-24 21:07:07 -07:00
syeopite 8435e79913 Improve documentation for extract_item(s) funcs 2021-09-24 21:07:07 -07:00
syeopite 30e85b40f9 Fix extract_videos 2021-09-24 21:07:07 -07:00
syeopite be1a43a337 Manually extract category refactor from 1b569bbc99207cae7c20aa285f42477ae361dd30
Also fixes some errors caused by cherry-picking
2021-09-24 21:07:07 -07:00
syeopite abca8f7a7c Rename invidiousitems.cr 2021-09-24 21:07:07 -07:00
syeopite 7b60dac526 Add description_html field to Category
(cherry picked from commit aa8f15f795787113e56473f8e8fd606749a14bdd)
2021-09-24 21:07:07 -07:00
syeopite ea6434662d Change typing of Category contents to only Array
(cherry picked from commit d3384e17f10d0baca70db7993df14100485be9da)
2021-09-24 21:07:06 -07:00
syeopite 0b7a108a59 Move continuation_token out of Category struct
(cherry picked from commit 0e96eda28f25171a0344b972af1852a4d6fc3007)
2021-09-24 21:07:06 -07:00
syeopite 57c63f3598 Rename "items_without_cate_items" to reflect usage 2021-09-24 21:07:06 -07:00
syeopite ae30f32c36 Unpack search items that are embedded in categories
This is a squash of a bunch of commits
cherry-picked commits

Fix category parse error on search

(cherry picked from commit cc02fed4e69f0eb5f19e017173632b3a3f20519f)

Fix category items not being extracted in search

(cherry picked from commit 2605b9c609ff217b5a6ae09d22450596dcad90fc)

Make search not include category items for now

(cherry picked from commit ca4afd59f46b595e3c339f31432cad98a5771ee1)

Change behavior of categories in search results

(cherry picked from commit cc1067561051b1c113b490e79c4a71cd346f7b3f)

Fix missing search results in extraction

(cherry picked from commit abda6840d5bfe58f845128bdd1a3f4916dd3bb84)

Fix miscount of search results

(cherry picked from commit 491e33450eb1300d0234bb33df0d0e78a027114f)
2021-09-24 21:07:06 -07: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
syeopite 1323b94b7a Rewrite extract_item and extract_items functions
This commit completely rewrites the extract_item and extract_items
function. Before this commit these two function were an unreadable
mess. The extract_item function was a lengthy if-elsif chain
while the extract_items function contained an incomprehensible
mess of .try, else and ||.

With this commit both of these functions have been pulled into a
separate file with the internal logic being moved to a few classes.

This significantly reduces the size of these two methods, enhances
readability and makes adding new extraction/parse rules much simpler.

See diff for details.

--
This cherry-picked commit also removes the code for parsing featured
channels present on the original.

(cherry picked from commit a027fbf7af1f96dc26fe5a610525ae52bcc40c28)
2021-09-24 21:06:46 -07:00
syeopite 387bddb51b Improve detection and handling of yt redirect links 2021-09-05 13:13:37 -07:00
syeopite a28945273d Propagate replacing yout.be links to /watch to RSS 2021-09-03 03:33:49 -07:00
syeopite fd6f03655e Fix typo causing links to be youtube.com/redirect 2021-09-03 03:30:36 -07:00
syeopite d984a898d4 Remove usage of haltf in /api/v1/channels/:ucid/comments 2021-08-23 17:07:45 -07:00
syeopite 52688106e4 Fix /api/v1/search/suggestions route link 2021-08-23 16:38:29 -07:00
syeopite 66b45a8fe2 Bountiful changes
- Use haltf in more locations
 - Fix wrong URL params
 - Rename API modules
 - Remove API routing file and move everything to general iv routing
   file
2021-08-23 16:28:30 -07:00
syeopite 39b34eece8 Extract API routes from invidious.cr (3/3)
- Auth (excluding notifications*) APIs
- Mixes

*Notifications currently require the "connection_channel" channel
for talking with the notifications job. Unfortunately, we cannot
access that within the route modules yet.
2021-08-14 00:18:25 -07:00
syeopite b3426fdc94 Restructure API routes to use more namespaces 2021-08-14 00:18:25 -07:00
syeopite 6aa65593ef Extract API routes from invidious.cr (2/?)
- Video playback endpoints
- Search feed api
- Video info api
2021-08-14 00:18:24 -07:00
syeopite 66becbf46f Restructure API route organisation 2021-08-14 00:18:24 -07:00
syeopite cbf3d75087 Extract API routes from invidious.cr (1/?) 2021-08-14 00:18:24 -07:00
syeopite 0b0036813f Remove deprecated APIs
- insights
- top feed
2021-08-14 00:18:03 -07:00
syeopite 46f8b04e40 Revert "bump crystal docker image version +"
This reverts commit f2b69fd812.

Crystal 1.1.0 is not supported by Invidious due to upstream issue. See
crystal-lang/crystal#10972
2021-08-12 16:10:40 -07:00
syeopite 2abec5b62f Use colorized version of safari-pinned-tab.svg 2021-07-25 16:07:11 -07:00
syeopite 31de2d304c Change README logo to use vector image 2021-07-24 15:14:58 -07:00
syeopite 39110ad21c Use struct for caption object 2021-07-11 16:17:22 -07:00
syeopite 57bb8c610a Use embed stream pull as fallback for gated videos 2021-07-02 00:25:00 -07:00
syeopite 54b19a04bb Fix caption parsing on age restricted videos 2021-06-27 08:35:28 -07:00
syeopite ca4df29670 Wrap comment 2021-06-25 14:14:41 -07:00
syeopite 7da0b2fd7f Switch from URI::Params.new to URI::Params.encode 2021-06-25 12:14:21 -07:00
syeopite aa55e67389 Fix extraction of age restricted videos 2021-06-25 07:51:51 -07:00
syeopite 349f073b8e Remove unnecessary "Welcome, " on username display 2021-06-19 06:03:50 -07:00
syeopite cb525af0a2 Connect to api.invidious.io with https 2021-06-19 04:17:49 -07:00
syeopite 7c49a0ba7a Rephrase auto instance redirect preference 2021-06-19 04:17:49 -07:00
syeopite 45e57f1ad3 Refactor fetch_random_instance 2021-06-19 04:17:49 -07:00
syeopite eb911de928 Handle if inst. api is down for rand inst fetch 2021-06-19 04:17:49 -07:00
syeopite b393e31b76 Fix inst. fetching for inst w/ disabled stats/err 2021-06-19 04:17:49 -07:00
syeopite 4a095eb98e Fix <hr> styling on empty search page 2021-06-19 04:17:49 -07:00
syeopite d793d4ba78 Add switch invidious instance btn to all chan tabs 2021-06-19 04:17:49 -07:00
syeopite 2f54ec4e18 Fix locale consistency for err template redirects 2021-06-19 04:17:46 -07:00
syeopite b9cd40fe1e Add redirect buttons to error template 2021-06-19 04:16:18 -07:00
syeopite 173cd7c15e Fix switch invidious instance btn on videos 2021-06-19 04:16:18 -07:00
syeopite 950c8f7104 Enhance fetch_random_instance func
Handle cross-inst. redirect w/ broken health stats

Add check for instance version in cross-redirect
2021-06-19 04:16:18 -07:00
syeopite b63bebb519 Allow automatic instance redirect to be turned off
Instead the "switch invidious instance" link would bring users to
redirect.invidious.io
2021-06-19 04:16:18 -07:00
syeopite cf72b34866 Fix locale discrepancy for instance redirect btn 2021-06-19 04:16:18 -07:00
syeopite d06cf2a07b Add playlist redirect 2021-06-19 04:16:18 -07:00
syeopite 10804927bb Add channel redirect 2021-06-19 04:16:18 -07:00
syeopite f178297452 Generalize redirect route 2021-06-19 04:16:18 -07:00
syeopite 311e7684b2 Add instance redirect on empty/broken search 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 b7aaae4a19 Add 'Switch Invidious Instance' to en locale 2021-06-19 04:16:17 -07:00
syeopite 008598b56f Change wording of redirect hyperlink 2021-06-19 04:16:17 -07:00
syeopite f3bc55e37e Expose instance redirect to frontend 2021-06-19 04:16:17 -07:00
syeopite 31fa3dfd59 Add route to redirect to another instance 2021-06-19 04:16:17 -07:00
syeopite 5b47438b71 Add helper function to fetch random instance 2021-06-19 04:16:17 -07:00
syeopite d432732959 Add ability to propagate locale removals 2021-06-13 07:23:45 -07:00
syeopite 4eb3de7b4e Fix typos 2021-06-13 06:56:17 -07:00
syeopite 2e6adfb44a Add locale-key-propagater and auto linter hooks 2021-06-13 06:40:04 -07:00
syeopite c85c6d0ac5 Add new line at end of locale files 2021-06-13 06:23:41 -07:00
syeopite 6c9dd8deb6 Change internal i18n key of sv-SE from sv to sv-SE 2021-06-13 06:23:18 -07:00
syeopite 8701de64ce Bump lsquic.cr shard version to v2.18.1-2 2021-06-10 04:49:19 -07:00
syeopite 114cac99e7 Update CI's crystal version 2021-06-09 16:34:54 -07:00
syeopite 392a363d02 Update Dockerfile for crystal 1.0 2021-06-08 13:20:46 -07:00
syeopite 0a87ba6930 Decode URL encoded preference cookie when parsing 2021-06-08 13:11:04 -07:00
syeopite 065c104f27 Upgrade to crystal 1.0.0 2021-06-08 13:10:58 -07:00
syeopite dd13392e36 Change wording of issue/pull locker message 2021-06-08 12:02:48 -07:00
syeopite abbc2bad35 Slash inactive days for issue locker by half 2021-06-05 13:51:11 -07:00
syeopite b491d69eec Formatting 2021-06-05 07:17:41 -07:00
syeopite d93514d327 Add workflow to lock stale closed issues 2021-06-05 07:16:07 -07:00
syeopite 445ff856fe Allow user preferences to effect extend_desc 2021-05-24 09:16:58 -07:00
syeopite f529948d81 Change videojs-vr to the unminified version 2021-05-23 09:24:49 -07:00
syeopite 4f3f51c583 Add "Interactive 360 degree videos: " to locales 2021-05-23 09:24:48 -07:00
syeopite 5ba9a1f87d Fix lint 2021-05-23 09:22:37 -07:00
syeopite a0fb75efcb Add licence for videojs-vr 2021-05-23 09:22:37 -07:00
syeopite 6e6f4d5a37 Allow configurable support of interactive 360 vid 2021-05-23 09:22:37 -07:00
syeopite f06053b1cf Fix projection settings for VR 2021-05-23 09:22:37 -07:00
syeopite df0cd30236 Add support for VR videos through videojs-vr 2021-05-23 09:22:29 -07:00
syeopite e6fba5d802 Fix locale discrepancy for extend desc feature 2021-05-10 00:34:34 -07:00
syeopite 50ba3c5d5c Remove unused class attr on label 2021-05-10 00:26:43 -07:00
syeopite 65663fb857 Update code to reflect 'read more' btn name change 2021-05-10 00:26:42 -07:00
syeopite 8df2f38d34 Change wording of 'read more/less' & add to locale 2021-05-10 00:25:22 -07:00
syeopite c5fae84263 Add functionality to read more button 2021-05-10 00:25:20 -07:00
syeopite d6585d7583 Overhaul Invidious's "Youtube" player style 2021-05-03 04:22:17 -07:00
syeopite 1924d75c2b Improve mobile user interface for video player 2021-05-03 03:44:33 -07:00
syeopite 06b27d932d Move player styling to separate file 2021-05-03 03:44:33 -07:00
syeopite ac1ac2cfed Add mobile-ui js to licenses 2021-05-03 03:44:33 -07:00
syeopite 53cdb04be7 Improve mobile ux with videojs-mobile-ui 2021-05-03 03:44:33 -07:00
syeopite 5c0458a887 Move navbar search bar render check to templated 2021-04-17 05:18:58 -07:00
syeopite 65942cd46c Rename empty.ecr to search_homepage.ecr 2021-04-17 05:16:35 -07:00
syeopite 45d687c4e1 Preserve url params in video aliases 2021-04-11 22:09:46 -07:00