Bravo List
Register
Go Back   > Bravo List > P2P > Forum > Downloads
Notices

Reply
Thread Tools
  #1  
Old 18th May 2025, 01:48
miralsplet's Avatar
miralsplet miralsplet is offline
Senior Member
 
Join Date: Nov 2013
P2P
Posts: 89
Default TSUEPlugin_Plex_Free_Movies
PHP Code:
<?php
function TSUEPlugin_Plex_Brezplacni_Filmi($pluginPosition ""$pluginOptions = array()) {
    global 
$TSUE;

    
// Nastavitve za Plex strežnik
    
$plexUrl "http://<IP naslov>:32400";
    
$token "<tvoj_avtorizacijski_žeton>";
    
$librarySection "Movies"// Ime sekcije v tvoji Plex knjižnici

    // API URL za pridobitev filmov
    
$apiUrl "{$plexUrl}/library/sections/{$librarySection}/all?X-Plex-Token={$token}";

    
// Pridobivanje podatkov iz Plex API-ja
    
$response file_get_contents($apiUrl);
    if (
$response === FALSE) {
        return 
"Napaka pri pridobivanju podatkov iz Plexa.";
    }
    
$data simplexml_load_string($response);

    
// Filtriranje filmov z oznako 'brezplačno'
    
$brezplacniFilmi = [];
    foreach (
$data->Video as $video) {
        if (
strpos($video->Tag'brezplačno') !== false) {
            
$brezplacniFilmi[] = $video;
        }
    }

    
// Generiranje HTML za prikaz filmov
    
$moviesHtml '<div class="plex-brezplacni-filmi-container">';
    foreach (
$brezplacniFilmi as $film) {
        
$title htmlspecialchars($film->Title);
        
$posterUrl "{$plexUrl}/photo/:/transcode?url={$film->thumb}&width=500&height=750";
        
$rating number_format($film->Rating1);
        
$releaseDate date('d M Y'strtotime($film->Year));

        
$moviesHtml .= '<div class="movie">';
        
$moviesHtml .= '<img src="' $posterUrl '" alt="' $title '">';
        
$moviesHtml .= '<div class="movie-info">';
        
$moviesHtml .= '<div class="movie-rating">' $rating '</div>';
        
$moviesHtml .= '<h3>' $title '</h3>';
        
$moviesHtml .= '<p>Datum izida: ' $releaseDate '</p>';
        
$moviesHtml .= '</div></div>';
    }
    
$moviesHtml .= '</div>';

    return 
$moviesHtml;
}
?>
And CSS

PHP Code:
.plex-brezplacni-filmi-container {
    
displayflex;
    
flex-wrapwrap;
    
justify-contentspace-around;
    
gap20px;
    
margin20px auto;
    
background-color#343a40;
    
padding30px;
    
border-radius12px;
    
box-shadowinset 0 0 10px rgba(0000.4), 0 0 20px rgba(0000.6);
    
max-width1200px;
}

.
plex-brezplacni-filmi-container .movie {
    
backgroundlinear-gradient(145deg#343a40, #495057);
    
padding20px;
    
widthcalc(25% - 20px);
    
border-radius12px;
    
box-shadow4px 4px 10px rgba(0000.2);
    
text-aligncenter;
    
transitiontransform 0.2s easebox-shadow 0.3s ease;
    
displayflex;
    
flex-directioncolumn;
    
height380px;
    
positionrelative;
    
overflowhidden;
}

.
plex-brezplacni-filmi-container .movie:hover {
    
transformtranslateY(-5px);
    
box-shadow4px 8px 20px rgba(0000.3);
}

.
plex-brezplacni-filmi-container .movie img {
    
width100%;
    
height75%;
    
object
::contentReference[oaicite:51]{index=51
Install:
🔧 Steps to Customize Plex Free Movies Plugin
1. Obtaining Access to the Plex API
To access the Plex API, you will need the following information:

Plex Server URL: This is usually something like this: http://<IP address>:32400.

Authorization Token: You can obtain this by logging into your Plex account and using the developer tools in your browser to obtain this token.

The Plex API provides access to various information in your library, including metadata for movies, series, and other content.

2. Searching for Free Movies
Since Plex does not offer a direct filter for "free" movies, we can use the following approaches to search:

Using Tags: If you used tags, such as free, when adding movies to your library, we can use these tags to filter the movies.

Using Categories: If you have movies categorized into different categories, we can search within specific categories that contain free movies.

3. Customizing the PHP plugin
The plugin can be customized to display movies from your Plex library that meet certain criteria (e.g., free tag)
Reply With Quote
The Following User Says Thank You to miralsplet For This Useful Post:
Fynnon (21st May 2025)
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 19:15. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2025, vBulletin Solutions Inc.