$ show trizen/pipe-viewer
Pipe Viewer is a Perl-based YouTube client providing both a CLI (`pipe-viewer`) and a GTK3 GUI (`gtk-pipe-viewer`). It allows users to search, stream, download, and manage YouTube content including videos, playlists, channels, comments, and captions. The core library `WWW::PipeViewer` abstracts YouTube data extraction via direct web scraping (ytInitialData, protobuf) and the Invidious API, with yt-dlp as a fallback for streaming URLs and comments. The architecture separates network resilience, caching, and format handling into reusable Perl modules (`DiskCache`, `Proto`, `ParseJSON`, etc.), though the CLI and GUI scripts are monolithic and tightly coupled to the library. External dependencies include `mpv`/`vlc` for playback, `yt-dlp` for advanced extraction, and `ffmpeg` for conversion. The project is actively maintained but operates on fragile, unofficial YouTube interfaces, making it susceptible to upstream changes.
The LLM identified 4 files worth highlighting for reuse:
Generic file-based cache with MD5 key hashing, automatic cleanup by mtime, and configurable expiration. Self-contained and could be reused in any Perl project for disk-backed caching.
Implements protobuf varint encoding for building YouTube search parameters. Standalone module with no internal dependencies, demonstrates non-obvious binary encoding in Perl.
Converts XML text to a Perl hash using regex-based parsing. Lightweight, self-contained, and useful for simple XML-to-structure conversion without heavy dependencies.
Precompiled regular expressions for extracting YouTube video, playlist, channel, and user IDs. Provides a clean, standalone library of reusable patterns for any YouTube-related parsing.