Youtube Viewer

# GTK Youtube Viewer

This application came to life in 12 September 2010 as my first Gtk2/Glade learning project.

gtk-youtube-viewer


Its scope is to search and play YouTube videos in a native player. It comes with various search options; it can search for videos, playlists and/or channels. The videos are streamed directly in a selected video player at the best resolution (customizable) and with closed-captions (if available).

By default, it comes with support for three video players: MPV (recommended), MPlayer and VLC, but it allows the addition of more players inside the configuration file.

For a better experience, the application comes with built-in authentication support, using the OAuth 2.0 mechanism. After inserting the authentication token, a new tab will appear, named "My panel", which has the following buttons:
  • Subscriptions
  • Favorited videos
  • Liked videos
  • Disliked videos
  • Uploads
  • Log out

See also:

# CLI Youtube Viewer

Inside the package, we can also find a CLI version, called "youtube-viewer", which includes all the functionality of GTK Youtube Viewer, and more.

youtube-viewer
"youtube-viewer" can be described as a semi-automatic tool for browsing YouTube. It has many advanced options, including search filtering based on various criteria, which makes it quite useful in practice.

usage: youtube-viewer [options] ([url] | [keywords])

== Base ==
   [URL]             : play an YouTube video by URL
   [keywords]        : search for YouTube videos
   [playlist URL]    : display a playlist of YouTube videos


== YouTube Options ==

 * Video tops:
   -t  --tops           : display the YouTube video tops
       --tops=all       : display all time YouTube video tops
   -r  --region=s       : list top videos for a specific region
   -M  --movies         : display the YouTube category of movies

 * Categories
   -c  --categories     : display the available YouTube categories
       --edu-categories : display the YouTube EDU categories
       --course-id=s    : list the video lectures from a course_ID
   -hl --catlang=s      : language for categories (default: en_US)
       --cats-region=s  : region code for categories (default: us)

 * Videos
   -uv --user-vid=s     : list videos uploaded by a specific user
   -cv --channel-vid=s  : list videos uploaded to a specific channel
   -uf --user-fav=s     : list the videos favorited by a specific user
   -id --videoids=s,s   : play YouTube videos by their IDs
   -rv --related=s      : show related videos for a video ID or URL
       --search=s       : search for YouTube videos (default mode)

 * Playlists
   -p  --playlists    : search for playlists of videos
       --pid=s        : list a playlist of videos by playlistID
       --pp=s,s       : play the videos from the given playlist IDs
       --ps=s         : add videos by ID or URL to a post-selected playlist
                        or in a given playlistID specified with `--pid`
       --position=i   : the position in a playlist where to add a video
   -up --user-pl=s    : list the playlists created by a specific user
   -cp --channel-pl=s : list the playlists belonging to a specific channel ID

 * Channels
   --channels         : search for Youtube channels

 * Shows
   -us --user-shows=s : display the shows belonging to a user
       --seasons=s    : get and print the seasons of a YouTube show_ID
       --episodes=s   : get and print the episodes for a show season_ID
       --clips=s      : get and print the clips for a show season_ID

* Comments
   --comments=s         : display comments for a YouTube video by ID or URL

 * Filtering
   --author=s           : search in videos uploaded by a specific user
   --channel-id=s       : search in videos belonging to a specific channel ID
   --duration=s         : filter search results based on video length
                          valid values are: short, medium, long
   --caption=s          : only videos with/without closed captions
                          valid values are: true, false
   --category=i         : search only for videos in a specific category ID
   --safe-search=s      : YouTube will skip restricted videos for your location
                          valid values are: none, moderate, strict
   --order=s            : order the results using a specific sorting method
                          valid values: date rating viewCount title videoCount
   --within=s           : show only videos uploaded within the specified time
                          valid values are: Nd, Nm, Ny, where N is a number
   --hd!                : search only for videos available in at least 720p
   --vd=s               : set the video definition (any, high or standard)
   --page=i             : get results starting with a specific page
   --results=i          : how many results to display per page (max: 50)
   -2  -3  -4  -7  -1   : resolutions: 240p, 360p, 480p, 720p and 1080p
   --resolution=s       : supported resolutions: original, 2160p, 1440p,
                          1080p, 720p, 480p, 360p, 240p, 144p, audio.

 * Account
   --login              : will prompt you for login
   --logout             : will delete the authentication key

 * [GET] Personal
   -F  --favorites:s     : show the latest favorited videos *
   -R  --recommended     : show the recommended videos for you *
   -S  --subscriptions:s : show the subscribed channels *
   -SV --subs-videos:s   : show the subscription videos *
       --subs-order=s    : change the subscription order
                           valid values: alphabetical, relevance, unread
   -L  --likes           : show the videos that you liked on YouTube *
       --dislikes        : show the videos that you disliked on YouTube *

* [POST] Personal
   --subscribe=s        : subscribe to a channel *
   --user-subscribe=s   : subscribe to a channel via username *
   --favorite=s         : favorite a YouTube video by URL or ID *
   --like=s             : send a 'like' rating to a video URL or ID *
   --dislike=s          : send a 'dislike' rating to a video URL or ID *

== Player Options ==

 * Arguments
   -f  --fullscreen!  : set the fullscreen mode for the selected video player
   -n  --novideo!     : play the music only without a video in the foreground
   --vo=s             : specify the video output for MPlayer
   --af=s             : specify an audio filter for MPlayer
   --append-arg=s     : append some command-line parameters to the media player
   --video-player=s   : select a video player to stream videos
                        available players: mpv, vlc, mplayer


== Download Options ==

 * Download
   -d  --download!       : activate the download mode
   -dp --downl-play!     : play the video after download (with -d)
   -rp --rem-played!     : delete a local video after played (with -dp)
       --wget-dl!        : download videos with wget (default: LWP)
       --dl-parallel     : download multiple videos at once
       --clobber!        : overwrite an existent video (with -d)
       --skip-if-exists! : don't download videos which already exists (with -d)
       --copy-caption!   : copy and rename the caption for downloaded videos
       --downloads-dir=s : downloads directory (set: '.')
       --filename=s      : set a custom format for the video filename (see: -T)

 * Convert
   --convert-cmd=s      : command for converting videos after download
                          which include the *IN* and *OUT* tokens
   --convert-to=s       : convert video to a specific format (with -d)
   --keep-original!     : keep the original video after converting


== Other Options ==

 * Behavior
   -A  --all!            : play all the video results in order
   -B  --backwards!      : play all video results in reverse order
   -s  --shuffle!        : shuffle the results of videos and playlists
   -I  --interactive!    : prompt for the first user input
       --std-input=s     : use this value as the first standard input
       --max-seconds=i   : don't play videos longer than i seconds
       --min-seconds=i   : don't play videos shorter than i seconds
       --combine-multi!  : combine multiple videos into one play instance
       --get-term-width! : allow youtube-viewer to read your terminal width
       --autohide!       : automatically hide watched videos
       --highlight!      : remember and highlight selected videos
       --confirm!        : show a confirmation message after each play

 * Closed-captions
   --get-captions!      : download the closed captions for videos
   --auto-captions!     : include or exclude auto-generated captions
   --captions-dir=s     : the directory where to download the .srt files

 * Config
   -U  --update-config! : update the configuration file before exit

 * Output
   -C  --colorful!      : use colors to delimit the video results
   -D  --details!       : a new look for the results, with more details
   -W  --fixed-width!   : adjust the results to fit inside the term width
   -i  --info=s         : show some info for a videoID or URL
   -e  --extract=s      : extract information from videos (see: -T)
       --extract-file=s : extract the information from videos in this file
       --dump=format    : dump metadata information in `videoID.format` files
                          valid formats: json, perl
   -q  --quiet          : do not display any warning
       --really-quiet   : do not display any warning or output
       --escape-info!   : quotemeta() the fields of the `--extract`
       --use-colors!    : enable or disable the ANSI colors for text

 * Other
   --http_proxy=s       : HTTP proxy to use, format 'http://domain.tld:port/'.
                          If authentication required,
                          use 'http://user:pass@domain.tld:port/'
   --dash!              : include or exclude the DASH itags
   --dash-mp4a!         : include or exclude the itags for MP4 audio streams


Help options:
   -T  --tricks         : show more 'hidden' features of youtube-viewer
   -E  --examples       : show some useful usage examples for youtube-viewer
   -H  --stdin-help     : show the valid stdin options for youtube-viewer
   -v  --version        : print version and exit
   -h  --help           : print help and exit
       --debug:1,2      : see behind the scenes

NOTES:
    *    -> requires authentication
    !    -> the argument can be negated with '--no'
    =i   -> requires an integer argument
    =s   -> requires an argument
    :s   -> can take an optional argument
    =s,s -> can take more arguments separated by commas

# Availability

Github: https://github.com/trizen/youtube-viewer
AUR: https://aur.archlinux.org/packages/gtk-youtube-viewer/