Kodi Community Forum
[RELEASE] Pneumatic - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] Pneumatic (/showthread.php?tid=97657)



RE: [RELEASE] Pneumatic - Dixon Butz - 2012-11-14

Did you set in Pneumatic the ip/port of the pc that sab is on?


RE: [RELEASE] Pneumatic - for4saken - 2012-11-14

(2012-11-14, 04:02)Dixon Butz Wrote: Did you set in Pneumatic the ip/port of the pc that sab is on?

Yes, everything else (CPS,SB,HP,SAB) intercommunicates. But it's late here, so I'll retry troubleshooting again tomorrow. (I've tried disabling Https in SAB anyway, but it didn't work.)

Thanks for trying to help.


RE: [RELEASE] Pneumatic - Popeye - 2012-11-14

(2012-11-12, 19:57)samukas Wrote: That's really nice to hear Smile Well, the part the it works of course!

I guess I speak for anyone here who has an ATV2 or Android device that I'm eager to try it out!
However, of course, feel free to clean up the code until you feel like it's polished enough... we will wait Smile

Thank you so much for this developments on Pneumatic.

I ran into some trouble since the new API isn't compatible with the rar inspection pneumatic does. I solved it by copying the first rar back to XBMC but realized a 100MB rar would take some time transfer. However I solved it this morning by just copying the first kb of the rar header and then run the rar inspection. Now I have everything ready for the code clean up and decent performance. Stay tuned Big Grin



RE: [RELEASE] Pneumatic - Popeye - 2012-11-15

Since there is a official Frodo Beta now, I'll speed up the development a bit...


RE: [RELEASE] Pneumatic - Skindred - 2012-11-16

(2012-07-05, 22:25)bwqbbq Wrote: Awesome plug-in! I've added support to CouchPotato and sent a pull request for it. You should probably work on the documentation though, not all of the API calls are described on Github :p

I was also wondering if you could add support for nzbget? Aside from SABnzbd, it's the other major usenet client and I actually prefer it because it is so lightweight and uses a lot less resources. I've had a look at your plug-in and I've cooked up a quick code sample for the things you need. Would be great if you could add support for it!

Code:
from xmlrpclib import ServerProxy
    rpc = ServerProxy('http://nzbget:tegbzn6789@localhost:6789/xmlrpc')

    # add nzb
    #
    rpc.append(nzb_name, 'movies', False, standard_b64encode(filedata.strip()))


    # wait for the nzb to get added to nzbget
    #
    groups = rpc.listgroups()
    while len(groups) == 0:
        groups = rpc.listgroups()

    last_group = len(groups) - 1
    while os.path.basename(groups[last_group]['NZBFilename']) != nzb_name:
        last_group = last_group - 1
        if last_group <= 0:
            last_group = len(groups) - 1
        groups = rpc.listgroups()
    
    first_id = groups[last_group]['FirstID']
    last_id  = groups[last_group]['LastID']

    # add to top of queue
    rpc.editqueue("GroupMoveTop", 0, "", last_id)


    files = rpc.listfiles(first_id, last_id)
    # you can loop through these and check the filename with files[index]['Filename']

Awesome work!


I expanded a bit on this, and made a PoC to delete all non-rar files,
using bits of your code, and bits of Popeye's code.


It is not usable but shows, that what we want, can be done.
The API provides all the things we need I believe and can be found at:
http://nzbget.sourceforge.net/RPC_API_reference

I am no Python coder however, and I fear this is about as far as I can get with this.
I delete the non-rar files in the wrong place, but for this PoC, it served the purpose.

If anyone is willing to expand even further on this, please feel free!

I would love to have Pneumatic interface with nzbget,
as SABnzbd+ only gets about 6MB/s max (when I get lucky) on my Synology DS212+ whereas nzbget can max my linespeed @ 11~12MB/s
This is no issue for streaming normal 720p, but for 1080i MPEG2 RAW series, this poses somewhat of a long waitingtime before the episode actually starts to play.
The only reason I still have SABnzbd+ installed, is for Pneumatic..

Code:
import re

RE_PART_X = r'(\S*?\.part\d{1,3}\.rar)'
RE_PART01_X = '(\S*?\.part0{0,2}1\.rar)'
RE_R_X = r'(\S*?\.[rs]\d{2,3})'
RE_RAR_X = r'(\S*?\.rar)'
RE_PART = '\.part\d{2,3}\.rar$'
RE_PART01 = '\.part0{1,2}1\.rar$'
RE_R = '\.[rs]\d{2,3}$'

def sorted_rar_nzf_file_list(nzf_list):
    file_list = []
    if len(nzf_list) > 0:
        for nzf in nzf_list:
            partrar = re.findall(RE_PART, nzf['Filename'])
            rrar = re.findall(RE_R, nzf['Filename'])
            if ((nzf['Filename'].endswith(".rar") and not partrar) or partrar or rrar):
                file_list.append(nzf['Filename'])
            else:
                partrar_x = re.search(RE_PART_X, nzf['Filename'])
                rrar_x = re.search(RE_R_X, nzf['Filename'])
                rarrar_x = re.search(RE_RAR_X, nzf['Filename'])
                out = None
                if (rarrar_x and not partrar_x):
                    out = rarrar_x.group(1)
                elif partrar_x:
                    out = partrar_x.group(1)
                elif rrar_x:
                    out = rrar_x.group(1)
#Print info on non-rar files
                print nzf['Filename']
                print nzf['ID']
#Delete the non-rar files
        rpc.editqueue("FileDelete", 0, "", nzf['ID'])        
        if len(file_list) > 1:
            file_list.sort(key=lambda x: x)
    return file_list


from xmlrpclib import ServerProxy
rpc = ServerProxy('http://nzbget:[email protected]:6789/xmlrpc')
groups = rpc.listgroups()
last_group = len(groups) - 1


#for i in groups:
#       print i['NZBNicename']



#Select the ID of the test group (NZB)
number=0

for t in groups:
    if t['NZBNicename'] == "Boardwalk.Empire.S01.1080p.BluRay.X264-BiRDHOUSE":
        selected_group = number
    number+=1



nzbid =  groups[selected_group]['NZBID']
nzbname = groups[selected_group]['NZBNicename']
first_id = groups[selected_group]['FirstID']
last_id  = groups[selected_group]['LastID']

#Use own Category
rpc.editqueue("GroupSetCategory", 0, "pneumatic", first_id)

#Disable PostProcessing
rpc.editqueue("GroupSetParameter", 0, "PostProcess=no", last_id)

#List all files in group
files = rpc.listfiles(first_id, last_id)

#for i in files:
#    print i['Filename']
#    print i['ID']


#Do the Regex Processing
sorted_rar_nzf_file_list(files)



RE: [RELEASE] Pneumatic - Popeye - 2012-11-16

For those who dare and are running xbmc an ATV2 and Android; try my latest commit to the pneumatic frodo-beta branch. Here I have added support for incomplete folder in XBMC managed shares (e.g. smb, nfs, ...). Browsing Incomplete folder of completed dl's doesn't work as well as browsing local nzb files. If you already have a locally mounted incomplete folder, then this is nothing for you and you should just wait for the next proper pneumatic release Big Grin


RE: [RELEASE] Pneumatic - Skindred - 2012-11-16

(2012-11-16, 02:47)Popeye Wrote: For those who dare and are running xbmc an ATV2 and Android; try my latest commit to the pneumatic frodo-beta branch. Here I have added support for incomplete folder in XBMC managed shares (e.g. smb, nfs, ...). Browsing Incomplete folder of completed dl's doesn't work as well as browsing local nzb files. If you already have a locally mounted incomplete folder, then this is nothing for you and you should just wait for the next proper pneumatic release Big Grin

Tested and working on iPad,
nice job!

Commands used:

Code:
cd
rm -rf /var/mobile/Library/Preferences/XBMC/addons/plugin.program.pneumatic/
git clone git://github.com/TsUPeR/xbmc-pneumatic.git /var/mobile/Library/Preferences/XBMC/addons/plugin.program.pneumatic/
cd /var/mobile/Library/Preferences/XBMC/addons/plugin.program.pneumatic/
git checkout -b frodo-beta origin/frodo-beta
chown -R mobile:mobile /var/mobile/Library/Preferences/XBMC/addons/plugin.program.pneumatic/

Then changed my SABnzbd API key (had SABnzbd installed on iPad aswell) and tested with a small HDTV episode.

Awesome news: Using the latest iOS nightly, I can skip forward, right up to the part of the last downloaded file.
If I skip beyond that one, playback stops.
But this means I can start playing, pause, skip a few parts back, or skip over segments.

Totally lovin' it!


At home, I can use the power of my Synology to do the downloading,
at a friends house, I can still use the iPad SABnzbd at half the speeds.

Pneumatic basicly allows me to stream my content, everywhere I have an internet connection.
It even works over 3G via tethering.

It's projects like these, that pave the way to a better and smoother user experience.
And XBMC is the true birthplace for all of this.


RE: [RELEASE] Pneumatic - redsoxboi21 - 2012-11-16

@Skindred

How can you use Pneumatic on 3G on your iPad? I thought you would have to be on wifi to use SABnzbd on your PC to use as a backbone?


RE: [RELEASE] Pneumatic - Skindred - 2012-11-16

(2012-11-16, 06:12)redsoxboi21 Wrote: @Skindred

How can you use Pneumatic on 3G on your iPad? I thought you would have to be on wifi to use SABnzbd on your PC to use as a backbone?

SABnzbd also runs on the iPad itself Wink
It's called iSABnzbd and can be installed via Cydia by adding a repository.

It works great with Pneumatic, just know that the SABnzbd speeds won't be fast.


RE: [RELEASE] Pneumatic - Popeye - 2012-11-16

(2012-11-16, 06:22)Skindred Wrote:
(2012-11-16, 06:12)redsoxboi21 Wrote: @Skindred

How can you use Pneumatic on 3G on your iPad? I thought you would have to be on wifi to use SABnzbd on your PC to use as a backbone?

SABnzbd also runs on the iPad itself Wink
It's called iSABnzbd and can be installed via Cydia by adding a repository.

It works great with Pneumatic, just know that the SABnzbd speeds won't be fast.

Skindred, glad you liked it but...
If you run SAB on the same device as Pneumatic then the Frodo-beta is nothing for you. The only added function is accessing the SAB incomplete folder over SMB or NFS.
Also, for installing just download the frodo-beta.zip and add it through the XBMC addon manager. For you who don't need xbmc - SMB or NFS support just install the repo repository.popeye-1.0.1.zip


For Nzbget I believe the best would be to fork Pneumatic since it relies heavily on SAB's structure and API's. If Nzbget has the same structure of nzb and file id's then there might be a possibility to create a common abstraction layer..


RE: [RELEASE] Pneumatic - Skindred - 2012-11-16

(2012-11-16, 10:16)Popeye Wrote:
(2012-11-16, 06:22)Skindred Wrote:
(2012-11-16, 06:12)redsoxboi21 Wrote: @Skindred

How can you use Pneumatic on 3G on your iPad? I thought you would have to be on wifi to use SABnzbd on your PC to use as a backbone?

SABnzbd also runs on the iPad itself Wink
It's called iSABnzbd and can be installed via Cydia by adding a repository.

It works great with Pneumatic, just know that the SABnzbd speeds won't be fast.

Skindred, glad you liked it but...
If you run SAB on the same device as Pneumatic then the Frodo-beta is nothing for you. The only added function is accessing the SAB incomplete folder over SMB or NFS.
Also, for installing just download the frodo-beta.zip and add it through the XBMC addon manager. For you who don't need xbmc - SMB or NFS support just install the repo repository.popeye-1.0.1.zip


For Nzbget I believe the best would be to fork Pneumatic since it relies heavily on SAB's structure and API's. If Nzbget has the same structure of nzb and file id's then there might be a possibility to create a common abstraction layer..

The frodo beta was ran against SABnzbd on my Synology Wink
Deleted all previous settings and configured the SMB vfs path.

Seems I forgot to mention that (as it seemed obvious).


I used to have a local SAB on iPad but I now use the remote SAB on my Synology with frodo-beta branch.




RE: [RELEASE] Pneumatic - Popeye - 2012-11-16

Excellent!


RE: [RELEASE] Pneumatic - ckergald - 2012-11-18

I've modified Popeye's newznab plugin to allow browsing by tv network, anyone interested can find it in This thread


RE: [RELEASE] Pneumatic - samfisher5986 - 2012-11-19

This is amazing, working nicely for me Smile


RE: [RELEASE] Pneumatic - samukas - 2012-11-19

Also quickly tested the Frodo version on my ATV2 this morning and it worked great (and fast as well, I might add!)
I had some issues at first where it kept asking me for my login and password of the network share even after I saved it (but this is an issue with XBMC and not Pneumatic)

Thank you, Popeye! Been waiting so long for this Big Grin