Skip to content

Commit 14d5ebe

Browse files
committed
- Added the ignored_projections config-option.
For example, to prefer rectagular versions of 360° videos, use: ignored_projections => ["mesh", "equirectangular"],
1 parent e244e34 commit 14d5ebe

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

bin/gtk-youtube-viewer

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ my %CONFIG = (
238238
fullscreen => 0,
239239
audio_only => 0,
240240

241+
ignored_projections => [],
242+
241243
autolike_watched => 0,
242244
autoscroll_to_end => 0,
243245

@@ -3490,6 +3492,8 @@ sub get_streaming_url {
34903492
dash => $CONFIG{dash_support},
34913493
dash_mp4_audio => $CONFIG{dash_mp4_audio},
34923494
dash_segmented => $CONFIG{dash_segmented},
3495+
3496+
ignored_projections => $CONFIG{ignored_projections},
34933497
);
34943498

34953499
return {

bin/youtube-viewer

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ my %CONFIG = (
257257
youtube_users_file => $youtube_users_file,
258258
remove_played_file => 0,
259259

260+
ignored_projections => [],
261+
260262
# Conversion options
261263
convert_cmd => 'ffmpeg -i *IN* *OUT*',
262264
convert_to => undef,
@@ -3823,6 +3825,8 @@ sub get_streaming_url {
38233825
dash => $dash,
38243826
dash_mp4_audio => ($opt{novideo} ? 1 : $opt{dash_mp4_audio}),
38253827
dash_segmented => ($opt{download_video} ? 0 : $opt{dash_segmented}),
3828+
3829+
ignored_projections => $opt{ignored_projections},
38263830
);
38273831

38283832
return {
@@ -5196,6 +5200,14 @@ If authentication is required, use:
51965200
51975201
Ignore videos in AV1 format.
51985202
5203+
=head2 ignored_projections
5204+
5205+
An array of video projects to ignore.
5206+
5207+
For example, to prefer rectagular versions of 360° videos, use:
5208+
5209+
ignored_projections => ["mesh", "equirectangular"],
5210+
51995211
=head2 interactive
52005212
52015213
Interactive mode, prompting for user-input.

lib/WWW/YoutubeViewer/Itags.pm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ sub _find_streaming_url {
176176
$args{ignore_av1} && next; # ignore videos in AV1 format
177177
}
178178

179+
# Ignored video projections
180+
if (ref($args{ignored_projections}) eq 'ARRAY') {
181+
if (grep { lc($entry->{projectionType} // '') eq lc($_) } @{$args{ignored_projections}}) {
182+
next;
183+
}
184+
}
185+
179186
if ($itag->{dash}) {
180187

181188
$args{dash} || next;

0 commit comments

Comments
 (0)