diff options
author | trizen <trizen@protonmail.com> | 2020-09-18 19:44:07 +0300 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-09-28 22:17:04 -0500 |
commit | 27774c9579fad5b7595c3f936597307feadaef9d (patch) | |
tree | ccb6664bd6e32a258befeb84f35c1b347b892fff /lib/WWW/FairViewer.pm | |
parent | 8caf34c363ee1554787104f1b90a820075833655 (diff) | |
download | fair-viewer-27774c9579fad5b7595c3f936597307feadaef9d.tar.lz fair-viewer-27774c9579fad5b7595c3f936597307feadaef9d.tar.xz fair-viewer-27774c9579fad5b7595c3f936597307feadaef9d.zip |
- Implemented `sort_by` and `date` parameters for `/search`. (https://github.com/iv-org/invidious/wiki/API#get-apiv1search)
In the CLI version, we have:
--order=s # valid values: relevance rating upload_date view_count
--date=s # valid values: hour today week month year
In the GTK3 version, this is implemented in the "Order by" and "Published within" comboboxes.
Also implemented the `--hd`, `--captions` and `--region=s` options.
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'lib/WWW/FairViewer.pm')
-rw-r--r-- | lib/WWW/FairViewer.pm | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/lib/WWW/FairViewer.pm b/lib/WWW/FairViewer.pm index 4e3bed8..5657c4c 100644 --- a/lib/WWW/FairViewer.pm +++ b/lib/WWW/FairViewer.pm @@ -46,34 +46,33 @@ our $VERSION = '1.0.4'; my %valid_options = ( # Main options - v => {valid => q[], default => 3}, - page => {valid => qr/^(?!0+\z)\d+\z/, default => 1}, - http_proxy => {valid => qr/./, default => undef}, - hl => {valid => qr/^\w+(?:[\-_]\w+)?\z/, default => undef}, - maxResults => {valid => [1 .. 50], default => 10}, - topicId => {valid => qr/./, default => undef}, - order => {valid => [qw(relevance date rating viewCount title videoCount)], default => undef}, - publishedAfter => {valid => qr/^\d+/, default => undef}, - publishedBefore => {valid => qr/^\d+/, default => undef}, - channelId => {valid => qr/^[-\w]{2,}\z/, default => undef}, - channelType => {valid => [qw(any show)], default => undef}, + v => {valid => q[], default => 3}, + page => {valid => qr/^(?!0+\z)\d+\z/, default => 1}, + http_proxy => {valid => qr/./, default => undef}, + hl => {valid => qr/^\w+(?:[\-_]\w+)?\z/, default => undef}, + maxResults => {valid => [1 .. 50], default => 10}, + order => {valid => [qw(relevance rating upload_date view_count)], default => undef}, + date => {valid => [qw(hour today week month year)], default => undef}, + + channelId => {valid => qr/^[-\w]{2,}\z/, default => undef}, + channelType => {valid => [qw(any show)], default => undef}, # Video only options - videoCaption => {valid => [qw(any closedCaption none)], default => undef}, - videoDefinition => {valid => [qw(any high standard)], default => undef}, - videoCategoryId => {valid => qr/^\d+\z/, default => undef}, - videoDimension => {valid => [qw(any 2d 3d)], default => undef}, - videoDuration => {valid => [qw(any short medium long)], default => undef}, - videoEmbeddable => {valid => [qw(any true)], default => undef}, - videoLicense => {valid => [qw(any creativeCommon youtube)], default => undef}, - videoSyndicated => {valid => [qw(any true)], default => undef}, - eventType => {valid => [qw(completed live upcoming)], default => undef}, - chart => {valid => [qw(mostPopular)], default => 'mostPopular'}, - - regionCode => {valid => qr/^[A-Z]{2}\z/i, default => undef}, + videoCaption => {valid => [qw(1 true)], default => undef}, + videoDefinition => {valid => [qw(high standard)], default => undef}, + videoCategoryId => {valid => qr/^\d+\z/, default => undef}, + videoDimension => {valid => [qw(2d 3d)], default => undef}, + videoDuration => {valid => [qw(short long)], default => undef}, + videoEmbeddable => {valid => [qw(true)], default => undef}, + videoLicense => {valid => [qw(creative_commons)], default => undef}, + videoSyndicated => {valid => [qw(true)], default => undef}, + eventType => {valid => [qw(completed live upcoming)], default => undef}, + chart => {valid => [qw(mostPopular)], default => 'mostPopular'}, + + region => {valid => qr/^[A-Z]{2}\z/i, default => undef}, relevanceLanguage => {valid => qr/^[a-z]+(?:\-\w+)?\z/i, default => undef}, safeSearch => {valid => [qw(none moderate strict)], default => undef}, - videoType => {valid => [qw(any episode movie)], default => undef}, + videoType => {valid => [qw(episode movie)], default => undef}, comments_order => {valid => [qw(top new)], default => 'top'}, subscriptions_order => {valid => [qw(alphabetical relevance unread)], default => undef}, @@ -669,7 +668,6 @@ sub default_arguments { #part => 'snippet', #prettyPrint => 'false', #maxResults => $self->get_maxResults, - #regionCode => $self->get_regionCode, %args, ); |