diff options
author | trizen <trizen@protonmail.com> | 2020-02-26 11:37:02 +0200 |
---|---|---|
committer | trizen <trizen@protonmail.com> | 2020-02-26 11:37:02 +0200 |
commit | f898eac5f4c62e0f2e279fc5c27c7c4892523f89 (patch) | |
tree | a139da2f26bc49f9eb8aad7c56c767567b0b9337 /lib | |
parent | 69da41f41ef6a23a4f7430bc0b00b7436e374b25 (diff) | |
download | fair-viewer-f898eac5f4c62e0f2e279fc5c27c7c4892523f89.tar.lz fair-viewer-f898eac5f4c62e0f2e279fc5c27c7c4892523f89.tar.xz fair-viewer-f898eac5f4c62e0f2e279fc5c27c7c4892523f89.zip |
- Fixed the "Author -> Uploads" entry.
- Set the default cache directory in /tmp
Diffstat (limited to 'lib')
-rw-r--r-- | lib/WWW/StrawViewer.pm | 3 | ||||
-rw-r--r-- | lib/WWW/StrawViewer/Channels.pm | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/WWW/StrawViewer.pm b/lib/WWW/StrawViewer.pm index 097d218..38fa317 100644 --- a/lib/WWW/StrawViewer.pm +++ b/lib/WWW/StrawViewer.pm @@ -284,8 +284,7 @@ sub set_lwp_useragent { my ($response) = @_; my $code = $response->code; - $code >= 500 # do not cache any bad response - or $code == 401 # don't cache an unauthorized response + $code >= 400 # do not cache any bad response or $response->request->method ne 'GET' # cache only GET requests # don't cache if "cache-control" specifies "max-age=0" or "no-store" diff --git a/lib/WWW/StrawViewer/Channels.pm b/lib/WWW/StrawViewer/Channels.pm index 309aa07..b2c2c99 100644 --- a/lib/WWW/StrawViewer/Channels.pm +++ b/lib/WWW/StrawViewer/Channels.pm @@ -28,6 +28,11 @@ sub videos_from_channel_id { return $self->_get_results($self->_make_feed_url("channels/$channel_id/videos")); } +sub videos_from_username { + my ($self, $channel_id) = @_; + return $self->_get_results($self->_make_feed_url("channels/$channel_id/videos")); +} + =head2 channels_from_categoryID($category_id) Return the YouTube channels associated with the specified category. |