StreamFinder

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        Also:  try harder to fetch artist, albumartist, and icon (from "embed" 
        URLs), since some channels allow public access to the "embed" version 
        of their URLs but NOT always to their main (html) ones (go figure).
2.22    2024/01/20
        - Remove StreamFinder::LinkTV (site no longer hosts videos onsite).
        - Mark StreamFinder::SoundCloud DEPRECIATED (now requires cookies and 
        trackers to be enabled onsite to browse, but song URLs still work here.
        - Minor module doc touchups (to note recent depreciations, etc.)
        - StreamFinder::Rumble - Add -bitrate (max kbps) option.
2.23    2024/01/28
        - StreamFinder::Rumble - Stop converting Rumble's "new" streaming URLs 
        to their "old" format (initiated by v2.20) since the new URLS now seem 
        to work properly and Rumble seems to be bandwidth-throttling the old 
        ones, I assume to force usage of the new ones and close the old hosts.
        - StreamFinder::Bitchute - Silence cpl. stray debug messages when 
        debug mode is not on.
        - Update copyright year to 2024.
2.30    2024/04/25
        - StreamFinder::Castbox - Refactor to scrape episode data from the 
        podcast page as now Castbox episode pages are no longer scrapable 
        (now dynamically generated by javascript), but for now, all required 

Changes  view on Meta::CPAN

        redo of their site (more Javascript & crap), but they have a second 
        site URL (api.bitchute.com) which still works well, so we autoconvert 
        non-working URLs from www.bitchute.com to api.bitchute.com.
2.40    2024/07/26
        - StreamFinder::Youtube - Refactor to add "-format-fallback" option to 
        allow specifying a second "-f <format-string>" option for use if no 
        streams match the "-format" option.  Defaults have been changed from 
        "mp4" to "best", and the "-format-fallback" defaults to "bestaudio".  
        These changes are required after 07/24 due to Youtube making (nearly) 
        all of their public streams either audio-only or video-only, which 
        are pretty much useless for streaming via your own media-player without 
        actually downloading the video (and remuxing to combine the audio and 
        video streams) to a file first!  Note:  The ability to do this is only 
        possible due to the Herculean efforts of the yt-dlp developers and 
        users are strongly encouraged to upgrade to the latest version 
        2024.07.25 to avoid likely just getting audio streams, as the internet 
        continues to get more crapped up and locked down every day. :(
2.41    2024/09/14
        - StreamFinder::AnyStream - Intercept & handle all .m3u8 (HLS) urls 
        in order to apply any "hls_bitrate" option limits and select the 
        highest one from the stream list if the HLS url is a master list.  

README  view on Meta::CPAN

    Player). "Fauxdacious" (<https://wildstar84.wordpress.com/fauxdacious/>)
    incorporates this module via a Perl helper-script to decode and play
    streams, along with their titles / station names, and station / podcast
    / video icons, artists / channel names, genres, and descriptions!

    Please NOTE: StreamFinder is a module, NOT a standalone application. It
    is designed to be used by other Perl applications. To create your own
    very simple application just to fetch stream data manually, simply grab
    the code in the SYNOPSIS section above, save it to an executable text
    file, ie. *StreamFinder.pl*, and run it from the command line with a
    supported streaming site URL as the argument. You can then edit it to
    tailor it to your needs.

    The currently-supported websites are: podcasts.apple.com podcasts
    (StreamFinder::Apple), bitchute.com videos (StreamFinder::Bitchute),
    blogger.com videos (StreamFinder::Blogger), ugetube.com videos
    (StreamFinder::BrandNewTube), brighteon.com videos
    (StreamFinder::Brighteon), castbox.fm podcasts (StreamFinder::Castbox),
    theepochtimes.com/epochtv videos (StreamFinder::EpochTV), iheart.com
    (aka iheartradio.com) radio stations and podcasts
    (StreamFinder::IHeartRadio), www.internet-radio.com radio stations

README  view on Meta::CPAN

    youtube.com, et. al and other sites that youtube-dl/yt-dlp support
    (StreamFinder::Youtube), zeno.fm radio stations and podcasts
    (StreamFinder::Zeno), and StreamFinder::Anystream - search any (other)
    webpage URL (not supported by any of the other submodules) for streams.

    NOTE: StreamFinder::Google has been removed as Google Podcasts has shut
    down.

    NOTE: StreamFinder::LinkTV has been removed as that site no longer
    provides streams anymore but only links to the various (and diverse)
    streaming sites that provide their own streams. Some may possibly work
    via StreamFinder::Youtube or StreamFinder::AnyStream.

    NOTE: StreamFinder::Goodpods has been removed, as that site has redone
    itself in javascript as to no longer be scrapable for streams.

    NOTE: StreamFinder::Podcastaddict is now considered depreciated and may
    be removed in a later StreamFinder release as it now requires a specific
    valid episode page to fetch streams from, as Podcastaddict.com has
    javascripted up their podcast pages now to the point that it is no
    longer possible to obtain a playlist from them via our scripts. However,

README  view on Meta::CPAN

    "genre", and / or a "year" (podcasts, videos, etc.), an AlbumArtist /
    channel URL, and possibly a second icon image for the channel (podcasts
    and videos). Some sites also provide radio stations' FCC call letters
    ("fccid"). For icon and image URLs, functions exist (getIconData() and
    getImageData()) to fetch the actual binary data and mime type for
    downloading to local storage for use by your application or preferred
    media player. NOTE: StreamFinder::Anystream is not able to return much
    beyond the stream URLs it finds, but please see it's POD documentation
    for details on what it is able to return.

    If you have another streaming site that is not supported, first, make
    sure you have youtube-dl installed and see if StreamFinder::Youtube can
    successfully fetch any streams for it. If not, then please file a
    feature request via email or the CPAN bug system, or (for faster
    service), provide a Perl patch module / program source that can extract
    some or all of the necessary information for streams on that site and
    I'll consider it! The easiest way to do this is to take one of the
    existing submodules, copy it to "StreamFinder::*YOURSITE*.pm", modify it
    (and the POD docs) to your specific site's needs, test it on several of
    their pages (see the "SYNOPSIS" code above), and send it to me (That's
    what I do when I want to add a new site)!

SUBROUTINES/METHODS
    new(*url* [, *options* ])
        Accepts a URL and creates and returns a new station, video, or
        podcast object, or *undef* if the URL is not a valid station or no
        streams are found.

        NOTE: Depending on the type of site being queried, the "station
        object" can be either a streaming station, a video, or a podcast,
        but works the same way (method calls, arguments, etc.).

        NOTE: A full URL must be specified here, but if using any of the
        subpackage modules directly instead, then either a full URL OR just
        the station / video / podcast's site ID may be used! Reason being
        that this function parses the full URL to determine which subpackage
        (site) module to use.

        *options* can vary depending on the type of site that is being
        queried. One option common to all sites is *-debug*, which turns on

lib/StreamFinder.pm  view on Meta::CPAN

"Audacious Audio Player).  "Fauxdacious" 
(L<https://wildstar84.wordpress.com/fauxdacious/>) incorporates this module via 
a Perl helper-script to decode and play streams, along with their titles / 
station names, and station / podcast / video icons, artists / channel names, 
genres, and descriptions! 

Please NOTE:  StreamFinder is a module, NOT a standalone application.  It is 
designed to be used by other Perl applications.  To create your own very simple 
application just to fetch stream data manually, simply grab the code in the 
B<SYNOPSIS> section above, save it to an executable text file, ie. 
I<StreamFinder.pl>, and run it from the command line with a supported streaming 
site URL as the argument.  You can then edit it to tailor it to your needs.

The currently-supported websites are:  
podcasts.apple.com podcasts (L<StreamFinder::Apple>), 
bitchute.com videos (L<StreamFinder::Bitchute>), 
blogger.com videos (L<StreamFinder::Blogger>), 
ugetube.com videos (L<StreamFinder::BrandNewTube>), 
brighteon.com videos (L<StreamFinder::Brighteon>), 
castbox.fm podcasts (L<StreamFinder::Castbox>), 
theepochtimes.com/epochtv videos (L<StreamFinder::EpochTV>), 

lib/StreamFinder.pm  view on Meta::CPAN

(L<StreamFinder::Tunein>), vimeo.com videos (L<StreamFinder::Vimeo>), 
youtube.com, et. al and other sites that youtube-dl/yt-dlp support 
(L<StreamFinder::Youtube>), 
zeno.fm radio stations and podcasts (L<StreamFinder::Zeno>), 
and L<StreamFinder::Anystream> - search any (other) webpage URL (not supported 
by any of the other submodules) for streams.  

NOTE:  StreamFinder::Google has been removed as Google Podcasts has shut down.

NOTE:  StreamFinder::LinkTV has been removed as that site no longer provides 
streams anymore but only links to the various (and diverse) streaming sites 
that provide their own streams.  Some may possibly work via 
StreamFinder::Youtube or StreamFinder::AnyStream.

NOTE:  StreamFinder::Goodpods has been removed, as that site has redone itself 
in javascript as to no longer be scrapable for streams.

NOTE:  StreamFinder::Podcastaddict is now considered depreciated and may be 
removed in a later StreamFinder release as it now requires a specific valid 
episode page to fetch streams from, as Podcastaddict.com has javascripted up 
their podcast pages now to the point that it is no longer possible to obtain 

lib/StreamFinder.pm  view on Meta::CPAN

"description", an "artist" / author, a "genre", and / or a "year" (podcasts, 
videos, etc.), an AlbumArtist / channel URL, and possibly a second 
icon image for the channel (podcasts and videos).  Some sites also provide 
radio stations' FCC call letters ("fccid").  For icon and image URLs, 
functions exist (getIconData() and getImageData()) to fetch the actual binary 
data and mime type for downloading to local storage for use by your 
application or preferred media player.  NOTE:  StreamFinder::Anystream is not 
able to return much beyond the stream URLs it finds, but please see it's POD 
documentation for details on what it is able to return.

If you have another streaming site that is not supported, first, make sure 
you have B<youtube-dl> installed and see if B<StreamFinder::Youtube> can 
successfully fetch any streams for it.  If not, then please file a feature 
request via email or the CPAN bug system, or (for faster service), provide a 
Perl patch module / program source that can extract some or all of the 
necessary information for streams on that site and I'll consider it!  The 
easiest way to do this is to take one of the existing submodules, copy it to 
"StreamFinder::I<YOURSITE>.pm", modify it (and the POD docs) to your 
specific site's needs, test it on several of their pages (see the "SYNOPSIS" 
code above), and send it to me (That's what I do when I want to add a 
new site)!

lib/StreamFinder.pm  view on Meta::CPAN


=over 4

=item B<new>(I<url> [, I<options> ])

Accepts a URL and creates and returns a new station, video, or 
podcast object, or I<undef> if the URL is not a valid station or 
no streams are found.

NOTE:  Depending on the type of site being queried, the "station 
object" can be either a streaming station, a video, or a podcast, 
but works the same way (method calls, arguments, etc.).

NOTE:  A full URL must be specified here, but if using any of the 
subpackage modules directly instead, then either a full URL OR just 
the station / video / podcast's site ID may be used!  Reason being 
that this function parses the full URL to determine which subpackage 
(site) module to use.

I<options> can vary depending on the type of site that is 
being queried.  One option common to all sites is I<-debug>, which 

lib/StreamFinder/EpochTV.pm  view on Meta::CPAN

returns a a new video object, or I<undef> if the URL is not a valid video, or 
no streams are found.  The URL can be the full URL, ie. 
https://www.theepochtimes.com/epochtv/B<channel_or_video-id>, or just 
B<channel_or_video-id>.  EpochTV can't really distinguish between episode and 
channel IDs except that channel pages do not contain a specific video stream 
URL, so if no stream URL is found, it assumes a channel page, in which case, 
the first (latest) episode is returned (along with the channel's playlist).

The optional I<-secure> argument can be either 0 or 1 (I<false> or I<true>).  
If 1 then only secure ("https://") streams will be returned.  Currently, 
all EpochTV streaming URLs are believed to be secure (https).

DEFAULT I<-secure> is 0 (false) - return all streams (http and https).

Additional options:

I<-log> => "I<logfile>"

Specify path to a log file.  If a valid and writable file is specified, A line 
will be appended to this file every time one or more streams is successfully 
fetched for a url.

lib/StreamFinder/EpochTV.pm  view on Meta::CPAN


=item $video->B<count>()

Returns the number of streams found for the video (will nearly always be 1).

=item $video->B<getID>()

Returns the video's EpochTV ID (default).  EpochTV video and channel IDs 
consist of combinations of lower-case letters, numbers and hyphens, and are 
indestinguishable from each other, except that channel pages don't return 
a specific video streaming URL, but rather fetch and return the first 
(latest) episode video's streaming URL and metadata.

=item $video->B<getTitle>(['desc'])

Returns the video's title, or (long description).  Videos 
on EpochTV can have separate descriptions, but for videos, 
it is always the video's title.

Note:  EpochTV video descriptions are usually incomplete, ending with a "..", 
since on the page itself there's a "Read More" button to view the rest, and 
"the rest" can only be obtained with Javascript.

lib/StreamFinder/Tunein.pm  view on Meta::CPAN

I<-notrim> is specified without argument, the default is 1 (I<true>).  Try 
using I<-notrim> if stream will not play without the extra arguments.

The optional I<-formats> argument can be either a comma-separated string or an 
array reference ([...]) of stream types to keep (include) and returned in 
order specified (type1, type2...).  Each "type" can be an extension 
(ie. mp3, acc, pls, etc.), or ("any" or "all" to keep all formats).

DEFAULT I<-formats> list is:  'all', meaning that all streams are accepted. 

NOTE:  I<-formats> only applies to streaming stations and is ignored for podcasts.

The optional I<-secure> argument can be either 0 or 1 (I<false> or I<true>).  
If 1 then only secure ("https://") streams will be returned.

DEFAULT I<-secure> is 0 (false) - return all streams (http and https).

WARNING!:  As of the latest StreamFinder release, almost ALL Tunein radio 
station streams are "insecure" (http)!

Additional options:



( run in 0.362 second using v1.01-cache-2.11-cpan-4d50c553e7e )