App-MHFS

 view release on metacpan or  search on metacpan

lib/MHFS/HTTP/Server.pm  view on Meta::CPAN

    say __PACKAGE__.": loading settings";
    my $settings = MHFS::Settings::load($launchsettings);
    if((exists $settings->{'flush'}) && ($settings->{'flush'})) {
        say __PACKAGE__.": setting autoflush on STDOUT and STDERR";
        STDOUT->autoflush(1);
        STDERR->autoflush(1);
    }

    # make the temp dirs
    make_path($settings->{'VIDEO_TMPDIR'}, $settings->{'MUSIC_TMPDIR'}, $settings->{'RUNTIME_DIR'}, $settings->{'GENERIC_TMPDIR'});
    make_path($settings->{'SECRET_TMPDIR'}, {chmod => 0600});
    make_path($settings->{'DATADIR'}, $settings->{'MHFS_TRACKER_TORRENT_DIR'});

    my $sock = IO::Socket::INET->new(Listen => 10000, LocalAddr => $settings->{'HOST'}, LocalPort => $settings->{'PORT'}, Proto => 'tcp', Reuse => 1, Blocking => 0);
    if(! $sock) {
        say "server: Cannot create self socket";
        return undef;
    }

    if(! $sock->setsockopt( SOL_SOCKET, SO_KEEPALIVE, 1)) {
        say "server: cannot setsockopt";

lib/MHFS/Plugin/MusicLibrary.pm  view on Meta::CPAN

            $file = $tlossy;

            if(defined LOCK_GET_LOCKDATA($tlossy)) {
                    # unlikely
                say "SendLocalTrack: lossy flac exists and is locked 503";
                $request->Send503;
                return;
            }
        }
        else {
            make_path($tmpfileloc, {chmod => 0755});
            my @cmd = ('ffmpeg', '-i', $file, '-c:a', 'flac', '-sample_fmt', 's16', $tlossy);
            my $buf;
            if(LOCK_WRITE($tlossy)) {
                $request->{'process'} = MHFS::Process->new(\@cmd, $evp, {
                'SIGCHLD' => sub {
                    UNLOCK_WRITE($tlossy);
                    SendLocalTrack($request,$tlossy);
                },
                'STDERR' => sub {
                    my ($terr) = @_;

lib/MHFS/Plugin/MusicLibrary.pm  view on Meta::CPAN


    # if we already transcoded/resampled, don't waste time doing it again
    foreach my $setting (@desired) {
        my $tmpfile = $tmpfileloc . $setting->[0] . '_' . $setting->[1] . '_' . $filebase;
        if(-e $tmpfile) {
            say "No need to resample $tmpfile exists";
            SendTrack($request, $tmpfile);
            return;
        }
    }
    make_path($tmpfileloc, {chmod => 0755});

    # resampling
    my $desiredrate;
    RATE_FACTOR: foreach my $key (keys %rates) {
        if(($samplerate % $key) == 0) {
            foreach my $rate (@{$rates{$key}}) {
                if(($rate <= $samplerate) && ($rate <= $max_sample_rate)) {
                    $desiredrate = $rate;
                    last RATE_FACTOR;
                }

lib/MHFS/Plugin/Youtube.pm  view on Meta::CPAN

    my $youtubedl = $settings->{'Youtube'}{'youtube-dl'};
    my $installed;
    if(!$youtubedl) {
        my $mhfsytdl = $settings->{'GENERIC_TMPDIR'}.'/youtube-dl';
        if(! -e $mhfsytdl) {
            say $pstart."Attempting to download youtube-dl";
            if(system('curl', '-L', 'https://yt-dl.org/downloads/latest/youtube-dl', '-o', $mhfsytdl) != 0) {
                say $pstart . "Failed to download youtube-dl. plugin load failed";
                return undef;
            }
            if(system('chmod', 'a+rx', $mhfsytdl) != 0) {
                say $pstart . "Failed to set youtube-dl permissions. plugin load failed";
                return undef;
            }
            $installed = 1;
            say $pstart."youtube-dl successfully installed!";
        }
        $youtubedl = $mhfsytdl;
    }
    elsif( ! -e $youtubedl) {
        say $pstart . "youtube-dl not found. plugin load failed";

share/public_html/static/music_inc/drflac.js  view on Meta::CPAN

async function Module(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope!="undefined";var ENVIRONMENT_IS_NODE=typeof process=="object"&&process.versions?....
;return moduleRtn}export default Module;

share/public_html/static/music_worklet_inprogress/decoder/bin/_mhfscl.js  view on Meta::CPAN

async function Module(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope!="undefined";var ENVIRONMENT_IS_NODE=typeof process=="object"&&process.versions?....
;return moduleRtn}export default Module;



( run in 1.113 second using v1.01-cache-2.11-cpan-39bf76dae61 )