Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
- Allow YouTube URLs to be passed to --id.
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Jul 15, 2020
1 parent 834a8ff commit 28f925f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/straw-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -2092,7 +2092,7 @@ sub rate_videos {
}

sub get_and_play_video_ids {
(my @ids = grep { get_valid_video_id($_) } @_) || return;
(my @ids = grep { defined($_) } map { get_valid_video_id($_) } @_) || return;

foreach my $id (@ids) {
my $info = $yv_obj->video_details($id);
Expand Down
2 changes: 1 addition & 1 deletion lib/WWW/StrawViewer/RegularExpressions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ our $get_username_playlists_re = qr{$get_username_videos_re/playlists};
# Video ID
my $video_id_re = qr/[0-9A-Za-z_\-]{11}/;
our $valid_video_id_re = qr{^$video_id_re\z};
our $get_video_id_re = qr{(?:%3F|\b)(?>v|embed|youtu[.]be)(?>[=/]|%3D)(?<video_id>$video_id_re)};
our $get_video_id_re = qr{(?:%3F|\b)(?>v|embed|youtu(?:\\)?[.]be)(?>(?:\\)?[=/]|%3D)(?<video_id>$video_id_re)};

# Playlist ID
our $valid_playlist_id_re = qr{^$generic_name_re\z};
Expand Down

0 comments on commit 28f925f

Please sign in to comment.