Kodi Community Forum

Full Version: [Smart Playlist] for Golden Globe (an other) nominees
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here is a quick and dirty warkaround to get a Smart Playlist for the current Golden Globe nominees.
This should also work for other awards.

What you need:
  • Browser Wink
  • Texteditor
  • Linux-Shell

How to do it:
  1. Copy the list of nominees to a textfile.
    http://www.imdb.com/oscars/nominations/golden-globes
    Image
    Uploaded with ImageShack.us
    Make sure IMDB displays the movie-tiltle in the same language you defined for the IMDB-scraper-plugin.
  2. Create a shell-script with this code:
    Code:
    #!/bin/sh
    echo -e "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n"
    echo -e "<smartplaylist type=\"movies\">\n"
    echo -e "<name>Golden Globe Nominees(2011)</name>\n"
    echo -e "<match>one</match>\n"
    echo -e ""

    cat $1 | grep -i "(" | sed s/:.*//g | sed s/.*for\ //g | sed s/\"//g | sed 's/ *(.*//g' | sort | uniq \
       | awk '{print "<rule field=\"title\" operator=\"is\">"$0"</rule>"}'

    echo -e ""
    echo -e "</smartplaylist>\n"
    Use the script to convert the raw list of nominees to a smart playlist for XBMC:
    Code:
    ./nominees2playlist.sh globe_nominees.txt > globe_nominees_2011.xsp
    The script just filters the movie-titles, deletes duplicates and builds the xml-tags for the playlist around it.
  3. Copy the generated XSP to your XBMC-folder (e.g. "c:\Users\<Username>\AppData\Roaming\XBMC\userdata\playlists\video\")

Things that need to be optimized:
  • This works only if the List of nominees and the movie-titles in XBMC use the same localization.
  • You need a Linux-Shell and basic know-how. Sad
  • Generate the same list for tvshows.

Its really sad, XBMC-smartplaylists don't support "imdbid".
This would make it much easier to generate such a playlist for every language.

Maybe someone could enhance the script to download the list of nominees with wget and still use the right localization.

Here is the finished smart playlist for the 2012 Golden Globe Nominees with german movie-titles.
globe_nominees_2012.xsp
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<smartplaylist type="movies">

<name>Golden Globe Nominees (2012)</name>

<match>one</match>


<rule field="title" operator="is">30 Rock</rule>
<rule field="title" operator="is">50/50</rule>
<rule field="title" operator="is">Albert Nobbs</rule>
<rule field="title" operator="is">American Horror Story - Die dunkle Seite in dir</rule>
<rule field="title" operator="is">Appropriate Adult</rule>
<rule field="title" operator="is">Arthur Weihnachtsmann</rule>
<rule field="title" operator="is">Beginners</rule>
<rule field="title" operator="is">Boardwalk Empire</rule>
<rule field="title" operator="is">Boss</rule>
<rule field="title" operator="is">Brautalarm</rule>
<rule field="title" operator="is">Breaking Bad</rule>
<rule field="title" operator="is">Californication</rule>
<rule field="title" operator="is">Cars 2</rule>
<rule field="title" operator="is">Cinema Verite</rule>
<rule field="title" operator="is">Crazy, Stupid, Love.</rule>
<rule field="title" operator="is">Der Gott des Gemetzels</rule>
<rule field="title" operator="is">Der Junge mit dem Fahrrad</rule>
<rule field="title" operator="is">Der gestiefelte Kater</rule>
<rule field="title" operator="is">Die Abenteuer von Tim und Struppi</rule>
<rule field="title" operator="is">Die Borgias - Sex. Macht. Mord. Amen.</rule>
<rule field="title" operator="is">Die Eiserne Lady</rule>
<rule field="title" operator="is">Die Haut in der ich wohne</rule>
<rule field="title" operator="is">Die Kunst zu gewinnen - Moneyball</rule>
<rule field="title" operator="is">Downton Abbey</rule>
<rule field="title" operator="is">Dr. Dani Santino - Spiel des Lebens</rule>
<rule field="title" operator="is">Drive</rule>
<rule field="title" operator="is">Eine dunkle Begierde</rule>
<rule field="title" operator="is">Enlightened</rule>
<rule field="title" operator="is">Episodes</rule>
<rule field="title" operator="is">Game of Thrones - Das Lied von Eis und Feuer</rule>
<rule field="title" operator="is">Gefährten</rule>
<rule field="title" operator="is">Glee</rule>
<rule field="title" operator="is">Gnomeo & Juliet</rule>
<rule field="title" operator="is">Good Wife</rule>
<rule field="title" operator="is">Homeland</rule>
<rule field="title" operator="is">Hugo Cabret</rule>
<rule field="title" operator="is">Hung - Um Längen besser</rule>
<rule field="title" operator="is">In the Land of Blood and Honey</rule>
<rule field="title" operator="is">J. Edgar</rule>
<rule field="title" operator="is">Jin líng shí san chai</rule>
<rule field="title" operator="is">Luther</rule>
<rule field="title" operator="is">Machine Gun Preacher</rule>
<rule field="title" operator="is">Midnight in Paris</rule>
<rule field="title" operator="is">Mildred Pierce</rule>
<rule field="title" operator="is">Modern Family</rule>
<rule field="title" operator="is">My Week with Marilyn</rule>
<rule field="title" operator="is">Nader und Simin - eine Trennung</rule>
<rule field="title" operator="is">New Girl</rule>
<rule field="title" operator="is">Page Eight</rule>
<rule field="title" operator="is">Parks and Recreation</rule>
<rule field="title" operator="is">Rango</rule>
<rule field="title" operator="is">Revenge</rule>
<rule field="title" operator="is">Shame</rule>
<rule field="title" operator="is">The Artist</rule>
<rule field="title" operator="is">The Big Bang Theory</rule>
<rule field="title" operator="is">The Big C ... und jetzt ich</rule>
<rule field="title" operator="is">The Descendants - Familie und andere Angelegenheiten</rule>
<rule field="title" operator="is">The Guard - Ein Ire sieht schwarz</rule>
<rule field="title" operator="is">The Help</rule>
<rule field="title" operator="is">The Hour</rule>
<rule field="title" operator="is">The Ides of March - Tage des Verrats</rule>
<rule field="title" operator="is">The Killing</rule>
<rule field="title" operator="is">Too Big to Fail - Die große Krise</rule>
<rule field="title" operator="is">Verblendung</rule>
<rule field="title" operator="is">W.E.</rule>
<rule field="title" operator="is">We Need to Talk About Kevin</rule>
<rule field="title" operator="is">Young Adult</rule>

</smartplaylist>

I still got some problems regarding the licalization.
In XBMC "The Ides of March - Tage des Verrats" got the alternate german title "Die Iden des März".
I don't know why it does not use the german imdb-display title.
For "Carnage" it just uses the original title even though imdb has the german title "Der Gott des Gemezelts" and uses it for the nominee-list.
Old post I know, I worked on something similar, haven't tested this yet - but the principal is the same. My idea is add this to cron perhaps and have a dynamic list? No error checking yet and is so far untested, I just copied the content of your code:

Code:
#!/bin/bash

URL="$1"
DIRECTORY="$2"
#IMDB_TOP_250="http://www.icheckmovies.com/lists/top+250/"
#ROTTEN_TOMATOES_TOP="http://www.icheckmovies.com/lists/best+of+rotten+tomatoes/"
#REDDIT_TOP_250="http://www.icheckmovies.com/lists/reddit+top+250/"
#ROGER_EBERT_GREAT_MOVIES="http://www.icheckmovies.com/lists/roger+ebert+the+great+movies/"
#MIND_FUCK_MOVIE_LIST="http://www.icheckmovies.com/lists/the+mindfuck+movie+list/mawbey/"
#AFI_TOP_100="http://www.icheckmovies.com/lists/afis+100+years...100+movies/"
#TOP_BOX_OFFICE="http://www.icheckmovies.com/lists/all-time+worldwide+box+office/"
#EMPIRE_TOP_500="http://www.icheckmovies.com/lists/empire+500/"
#IMDB_TOP_500_HORROR="http://www.icheckmovies.com/lists/top+500+horror+movies/"
#GUARDIAN_TOP_1000_BEFORE_YOU_DIE="http://www.icheckmovies.com/lists/the+guardians+1000+films+to+see+before+you+die/gorro/"
#SIGHT_AND_SOUND_CRITICS="http://www.icheckmovies.com/lists/sight+and+sound+2012+-+critics+list/peacefulanarchy/"


if [ -z "$URL" ]; then
        echo "No URL provided, please run again with a URL from http://www.icheckmovies.com/lists"
        exit 1
fi

if [ ! -d "$DIRECTORY" ]; then
        echo "$DIRECTORY invalid"
        exit 1
fi

echo $URL | grep -q "http://www.icheckmovies.com/lists/"
        if [ "$?" -ne "1" ]; then

for LIST in $URL;
        do
                curl -Is $LIST | head -n1 | grep -q 200 2>/dev/null
                if [ "$?" -ne "0" ]; then
                        echo "$URL currently offline."
                        exit 1
                else
                        NAME=$(echo $LIST | awk -F"/" '{print $5}' | tr "+" " ")
                        FILENAME=$(echo -e $NAME | tr " " "_").xsp
                        if [ -f $DIRECTORY/"$FILENAME" ]; then
                                echo $DIRECTORY/$FILENAME already exists, exiting.
                                exit 1
                        else
                                echo "Writing smart playlist to $DIRECTORY/$FILENAME"
                                echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>' >> $DIRECTORY/"$FILENAME"
                                echo '<smartplaylist type="movies">' >> $DIRECTORY/"$FILENAME"
                                echo "<name>$NAME</name>" >> $DIRECTORY/"$FILENAME"
                                echo "<match>one</match>" >> $DIRECTORY/"$FILENAME"
                                echo "" >> $DIRECTORY/"$FILENAME"
                                IFS=$(echo -en "\n\b")
                                for MOVIE in `curl -s $LIST 2>/dev/null | grep "data-movie-link=" | awk '/title/,/><\a>/' | awk -F'"' '{print $8}' | sed 's/View\ detailed\ information\ on\ /''/' | sed 's/'/'"'"'/' | sed 's/–/-/' | sed 's/á/a/' | sed 's/.\{7\}$//'`;
                                do
                                        echo '<rule field="title" operator="is">'$MOVIE'</rule>' >> $DIRECTORY/"$FILENAME"
                                done
                                for MOVIE in `curl -s $LIST 2>/dev/null | grep "a.k.a" | grep "<em>" | awk -F"<" '{print $4}' | sed 's/^...//' | sed 's/'/'"'"'/' | sed 's/á/a/' | sed 's/–/-/'`;
                                do
                                        echo '<rule field="title" operator="is">'$MOVIE'</rule>' >> $DIRECTORY/"$FILENAME"
                                done
                                echo "</smartplaylist>" >> $DIRECTORY/"$FILENAME"
                        fi
                fi

        done
        else
                echo "$URL is not valid, should contain http://www.icheckmovies.com/lists/"
                exit 1
        fi

To run the code, put it in a file (on linux), for example smart_playlist.sh, change the ownership so it's executable (chmod 755 smart_playlist.sh) and provide a url and a directory where the smart playlist will be written to. So for example:

Code:
./smart_playlist http://www.icheckmovies.com/lists/top+250/ /tmp
This is painfully slow, borderline unusable. There must be a better way of doing this Sad Anything with more than say 100 results slows down to a halt, possible it's my internet... But I doubt it, enjoy the feature anyway. Incidently the coding tags on this forum make this code unusual in it's current context.