Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
thoughts on trakt on 100 series ?
05-04-2012, 05:23 PM
Post: #1
thoughts on trakt on 100 series ?
Hi I've had some thoughts on this.

100 series plays stuff via 'mono' or something else for dvds that mounts the dvd image.

As far as mono is concerned...

When you start playing something any bookmark entry in /tmp/mon_bookmark is removed.

When you stop playing a movie part way through - A new entry is written to /tmp/mono_bookmark
Code:
bookmark_time=932 toadj=0 bookmark_filename=/opt/sybhttpd/localhost.drives/NETWORK_SHARE/nasb/data/Movies/The Mist (2007) - 15/TheMist.mkv

If it plays to the very end then no bookmark entry is added.

I think there is enough information here to write a trakt 'scrobbler'

The application should
1. Note name of file being played
2. Watch or Start mono and wait for it to end(*)
3. Inspect bookmark files
- if none present and no errors movie was watched to bitter end. (credits etc)
- if bookmark present then movie was stopped at some number of minutes (bookmark_time)

Now all that remains is
a. Map the media file to a real movie.
b. Get the runtime to calculate a percentage. if bookmark exists.
c. Send to trakt if considered "watched" eg 80% etc. (eg using wget )

To get the media an runtime information, simply search through YAMJ xml or Oversight index.db for the movie path, and picking up the associated IMDB and runtime. )

(*)The application can either be written as a mono-wrapper - this uses less resource but can cause installation headaches... OR
it can be a long running process the wakes up every 5 minutes to see what mono is up to...

Eg.
PHP Code:
# ps | grep mono
  
600 root       1:05 mono -single file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/nasb/data/Movies/The Mist (2007) - 15/TheMist.mkv -dram 1 

Runtime from Oversight (this is the IMDB/TMDB runtime - not the actual runtime - eg for Directors cuts etc)
PHP Code:
fgrep 'nasb/data/Movies/The Mist (2007) - 15/TheMist.mkv' /share/Apps/oversight/index.db sed 's/.*_rt//;s/_.*//'
        
126 

Movie Id from Oversight
PHP Code:
fgrep 'nasb/data/Movies/The Mist (2007) - 15/TheMist.mkv' /share/Apps/oversight/index.db sed 's/.*_U//;s/_.*//'
         
imdb:tt0884328 themoviedb:5876 

I personally think it would be better to keep this seperate from Oversight/YAMJ as it can easily be adapted to either( or both) by changing the last two steps.

Also as its 100 series specific, and will either add a long running process or a mono-wrapper. Two things I've tried to avoid in Oversight standard install.

There is no need for a lot of package/language dependencies to do this. It can all be done from a bash script. The NMT is a small embedded platform, so I think its good to try to keep resources and dependencies to a minimum.

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 05:30 PM
Post: #2
RE: thoughts on trakt on 100 series ?
You might want to speak to jwaulers as he's done pchTrakt for the 200/300 series - see sig below

Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 05:41 PM (This post was last modified: 05-04-2012 05:48 PM by lordy.)
Post: #3
RE: thoughts on trakt on 100 series ?
@Baz, yup aware of that. It uses to 200 series URL API to get info on what is playing, which is not on 100 series.
A few people have been asking for Oversight to do this on 100 series. So I put this post up, hopefully someone will do it Smile

I dont use my 100 series with anger, and for other reasons mentioned in the post, I dont have great incentive to do it.
(I'm open to - ahem - persuasion though - but otherwise its not a personal itch I'm desperate to scratch at the moment)

It would also be another component I need to test every release of Oversight, which is complicated enough already (unpacking, automounting, combining media across NMT, etc)

But I think it's very feasable so maybe someone will have a go...

Also I'm aware that the 100 local package is not the same as the 200, but the trkt.tv api is relatively simple , I think all the local package dependencies can be avoided by a few lines of bash/wget etc?

But I may speak to him on getting his 200 version working with Oversight Smile

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 06:02 PM
Post: #4
RE: thoughts on trakt on 100 series ?
Good stuff - I was just making sure you weren't reinventing the wheel Smile

Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 07:15 PM
Post: #5
RE: thoughts on trakt on 100 series ?
(05-04-2012 05:41 PM)lordy Wrote:  @Baz, yup aware of that. It uses to 200 series URL API to get info on what is playing, which is not on 100 series.
A few people have been asking for Oversight to do this on 100 series. So I put this post up, hopefully someone will do it Smile

I dont use my 100 series with anger, and for other reasons mentioned in the post, I dont have great incentive to do it.
(I'm open to - ahem - persuasion though - but otherwise its not a personal itch I'm desperate to scratch at the moment)

It would also be another component I need to test every release of Oversight, which is complicated enough already (unpacking, automounting, combining media across NMT, etc)

But I think it's very feasable so maybe someone will have a go...

Also I'm aware that the 100 local package is not the same as the 200, but the trkt.tv api is relatively simple , I think all the local package dependencies can be avoided by a few lines of bash/wget etc?

But I may speak to him on getting his 200 version working with Oversight Smile

The install (opkg) for this is based on my python installs, so this should also work on the A1xx's as my python programs do.

I had a look at getting this going on the A1xx's using /tmp/gaya(?) to show what is now playing, but was unsure how it get this infomation from /tmp/gaya. Does not the A1xx's store what is playing somewhere so it can resume from a stopped file?

Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 08:29 PM (This post was last modified: 05-04-2012 08:29 PM by lordy.)
Post: #6
RE: thoughts on trakt on 100 series ?
Hi, /tmp/mono_bookmark as in first post? or do you mean something else?

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 08:51 PM (This post was last modified: 05-04-2012 08:54 PM by jhmiller.)
Post: #7
RE: thoughts on trakt on 100 series ?
To be honest, i missed that, link took me to your second post and i scrolled down and replyed Angle

Did some research and it is possable to do this in php but curl and so opkg is still needed, not sure if that helps you.

My bash skills are still comming along so not sure if there is another way to send the api request with a command other then curl.

Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 08:52 PM (This post was last modified: 05-07-2012 07:26 PM by jlauwers.)
Post: #8
RE: thoughts on trakt on 100 series ?
Well, if anyone wants to fork pchtrakt/help me for the 100 series integration You would be welcome lol Big Grin

Everything is done except knowing what's playing... so just one class to update (pch.py)
(few other stuff too but should be pretty easy)

About the locale stuff it's nothing... it's just to have git --> easy install/auto-update.
I can put everything in the zip file.

And yes I the install script is greatly inspired by those from sabnzbd and sickbeard! Thanks jhmiller Angle

BTW I don't understand why you would "2. Watch or Start mono and wait for it to end(*)"

[Image: all-banner@2x.jpg]
Pchtrakt - Scrobble what you are playing on your popcorn-hour to trakt.tv
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 09:56 PM (This post was last modified: 05-04-2012 10:03 PM by lordy.)
Post: #9
RE: thoughts on trakt on 100 series ?
@jhmiller
Quote: not sure if there is another way to send the api request with a command other then curl

wget --post-data probably ?
[update: ah you mean libcurl? if not you could just exec wget ]

@jlauwers -
Quote:Everything is done except knowing what's playing
I don't understand why you would "2. Watch or Start mono and wait for it to end

to know what is playing?

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 11:12 PM
Post: #10
RE: thoughts on trakt on 100 series ?
Yes but by mono... you mean the open .Net framework? Huh

[Image: all-banner@2x.jpg]
Pchtrakt - Scrobble what you are playing on your popcorn-hour to trakt.tv
Find all posts by this user
Add Thank You Quote this message in a reply
05-04-2012, 11:44 PM
Post: #11
RE: thoughts on trakt on 100 series ?
Ah sorry, mono is also the name of one of the video playback programs on 100 series.
There is also another one used for ISO playback.

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
05-05-2012, 01:19 AM (This post was last modified: 05-05-2012 01:20 AM by accident.)
Post: #12
RE: thoughts on trakt on 100 series ?
/tmp/setting.txt will have a list of last 10 things player independent.. not sure if it makes a bookmark when you let a video play to end though. it's the same format on the 200 series if you don't have a 110 to code against.
Find all posts by this user
Add Thank You Quote this message in a reply
05-05-2012, 02:01 AM (This post was last modified: 05-05-2012 02:02 AM by lordy.)
Post: #13
RE: thoughts on trakt on 100 series ?
It definitely used to be in /tmp/setting.txt but I think they moved it in a prior firmware release:
Code:
/tmp # cat /mnt/syb8634/VERSION
00-17-091216-15-POP-403

/tmp # grep Mist /tmp/setting.txt
/tmp # grep Mist /tmp/mono_bookmark
bookmark_time=6486 toadj=0 bookmark_filename=/opt/sybhttpd/localhost.drives/NETWORK_SHARE/nasb/data/Movies/The Mist (2007) - 15/TheMist.mkv

Agree, It doesnt make a bookmark if video plays to the end (more details post#1)

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to lordy for this post
05-06-2012, 04:01 PM (This post was last modified: 05-06-2012 04:03 PM by jhmiller.)
Post: #14
RE: thoughts on trakt on 100 series ?
Should be able to modify the C200 code to look for the bookmark, well it is as i have just tried

Code:
bashCommand = "grep bookmark_filename=/ /tmp/mono_bookmark"
import subprocess
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output = process.communicate()[0]

output contains "bookmark_time=6486 toadj=0 bookmark_filename=/opt/sybhttpd/localhost.drives/NETWORK_SHARE/nasb/data/Movies/The Mist (2007) - 15/TheMist.mkv"

so now all thats needed is to strip out whats needed in to the variables used by the trak program to sort/publish

But does that show while playing or only when stopped?

Find all posts by this user
Add Thank You Quote this message in a reply
05-06-2012, 04:27 PM (This post was last modified: 05-06-2012 04:28 PM by lordy.)
Post: #15
RE: thoughts on trakt on 100 series ?
The bookmark is only present when playback is stopped before the end.

So you have to monitor mono process for activity to detect something that is played from beginning to the very end, as there is no other information written about it. eg ps | grep mono or look in ls -l /proc/pid/fd

Or write a wrapper script (but this might interfere with mono_wrapper), and needs to be uninstalled, a bit too intrusive but ..
PHP Code:
#!/bin/sh
echo "mono $@" > /some/file/mono.args
exec 
/bin/mono.real "$@" 

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  PlayOn on the 100 series. emveepee 0 1,453 12-22-2010 08:21 AM
Last Post: emveepee
  ccextractor for popcornhour A100-series TheDeath 0 1,716 02-13-2010 05:17 AM
Last Post: TheDeath
Brick lcdproc-0.5.3 for Popcorn Hour 100 series (Soundgraph iMON VFD LCD etc.) MATPOC 13 8,138 01-12-2010 05:21 AM
Last Post: emveepee
Brick lirc-0.8.4a for Popcorn Hour 100 series (Soundgraph iMON etc.) MATPOC 1 3,402 01-08-2010 05:21 PM
Last Post: MATPOC
  Cool tool for renaming Tvshow files & d/l Series & Episode information excal 19 15,565 10-26-2009 06:42 PM
Last Post: ciao
  100 series toolchain tweak.. lordy 0 1,255 10-08-2009 12:19 PM
Last Post: lordy
  Firmware 01-17-090125-15-POP-403 thoughts Delphy 0 990 02-26-2009 03:31 PM
Last Post: Delphy

Forum Jump: