MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
Thread Tools Display Modes
Old 2008-05-18, 05:31   #331 (permalink)
Portal Member
 
jburnette's Avatar
 
Join Date: Aug 2006
Location: Kentucky
Age: 23
Posts: 700
Thanks: 125
Thanked 90 Times in 49 Posts

Country:

My System

Default

It's in the plugin SVN.

SourceForge.net Repository - [mp-plugins] Index of /trunk/plugins
jburnette is offline   Reply With Quote
Old 2008-05-18, 18:00   #332 (permalink)
Portal Member
 
jburnette's Avatar
 
Join Date: Aug 2006
Location: Kentucky
Age: 23
Posts: 700
Thanks: 125
Thanked 90 Times in 49 Posts

Country:

My System

Default

Also, if you really want some logging, set your log level to debug and watch your logs get HUGE. We do log, it's just kind of random what's logged. Over the past year or so I've added debug logging to random parts to troubleshoot issues and never removed it.
jburnette is offline   Reply With Quote
Old 2008-05-18, 18:26   #333 (permalink)
Portal Member
 
Join Date: Apr 2008
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post


Default

Thanks!

So, I looked at the code, and found what the problem is... The HTML returned by newzbin is slightly different from what 'newzbinhtml' search is looking for. In particular, the title is now in '<td class="title">' tag instead of '<td colspan="3" class="title">'. I'm not sure if this is due to some setup differences in newzbin between me and others, or if newzbin guys simply changed their HTML a bit. A couple of other small changes were needed, too (the category is in a different place in HTML, too), but I got it working well now.

What I changed is this:

- everywhere you had td colspan="3" class="title", I changed it to just td class="title" (in 3 places in the function)
- changed the middle parsing part of the code (title, id, size, cat) to this:

Quote:
title = cont.Remove(0, InStr(cont, "browse/post/"))
title = title.Remove(0, Len("browse/post/") - 1)
id = title.Remove(InStr(title, "/") - 1)
title = title.Remove(0, InStr(title, ">"))
title = title.Remove(InStr(title, "<") - 1)
size = cont.Remove(0, InStr(cont, "fileSize"))
size = size.Remove(0, InStr(size, ">"))
size = size.Remove(0, InStr(size, ">"))
size = size.Remove(InStr(size, "<") - 1)

cat = cont.Remove(0, InStr(cont, "/browse/category"))
cat = cat.Remove(0, InStr(cat, ">"))
cat = cat.Remove(InStr(cat, "<") - 1)

Dim r As Regex = New Regex("\s\s")

cat = r.Replace(cat, "")
cat = cat.Replace(";", " | ")
cat = cat.Replace(":", ": ")
cat = cat.Replace(" ,", ", ")
cat = cat.Replace(" ", " ")
title = title.Replace("&amp;", "&")
And, that's all! Both stored searches and manual searches worked fine after this.

Another crash I found was when one of my stored searches had '&' in the name... That got translated into '&amp;' and stored like that in the config file. The semicolon in there confused the parser when trying to figure out the URL for the stored search... I haven't looked into a fix -- I'll just remove the ampersand from the search name for now .
Pulzar is offline   Reply With Quote
This User Say Thank You:
Old 2008-05-19, 23:53   #334 (permalink)
Portal Member
 
Join Date: Mar 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

Hi.

This is a nice little plugin, but sadly I don't need to use it as I do most of my Usenet stuff remotely using SABnzbd's web interface. What would be really nice, and was mentioned earlier in this thread, would be to implement something like NZBPlayer: NZBPlayer - Stream Videos from Usenet Newsgroups - NZB Streaming

I could envisage being able to browse through a Newzbin feed, select something I want to watch, click, click and a less than a minute later the file starts playing as it's downloading. Ideally, it'd get saved somewhere convenient for later archiving, etc. At the simples I guess it would just be a question of passing the NZB file to NZB Player, but if someone could write something integrated into MP, well... that would be special. Of course, I realise that would involve writing a usenet downloader, so that's not an trivial amount of work.
bazzz is offline   Reply With Quote
Old 2008-05-20, 01:02   #335 (permalink)
Portal Member
 
Join Date: Apr 2008
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post


Default

That is quite cool -- I imagine it wouldn't be too hard to get that into mediaportal... nzbplayer really only downloads and unrars files on the fly, and it then sends them to a streaming (external) video player. Mediaportal supports external players, so as long as nzbplayer can be made to work in the background and then open up a player inside MP, that would work.

I still need a plugin like this, though, as I want to use my remote/TV to pick what I want to download. I added a little piece of code to this plugin that filters out newzbin results if I already have them in my MP-TVSeries plugin database, so it basically only shows me links to episodes I'm missing (usually, new ones). A button-press on the remote, and the download starts, and then MP-TVSeries picks it up automatically and it's available to be watched -- no web, no keyboard, nothing else is needed.

Now, if this streaming idea can be added to the mix, then even the wait would be gone... That would be very cool!
Pulzar is offline   Reply With Quote
Old 2008-05-21, 20:29   #336 (permalink)
Portal Member
 
jburnette's Avatar
 
Join Date: Aug 2006
Location: Kentucky
Age: 23
Posts: 700
Thanks: 125
Thanked 90 Times in 49 Posts

Country:

My System

Default

Pulzar,
I certainly do appreciate the work you've done there, but I'm not exactly sure what the problem was to begin with? Newzbin works fine for me. Is that for a different listings style than v3 attrs in table? Again, though, I do appreciate the work you've done.

bazz,
Implementation of an nzbplayer like interface has definitely been discussed before, but I'm not sure it's going to happen for quite some time. I would personally never use it, but that's not really an issue as I'm more than happy to accommodate. If someone wants to do the backend work and write the unraring (from a non-complete set) routines, I'd gladly implement it in MyUsenet. g_player (MediaPortal's DirectShow player) won't play video data from a memory stream as far as I know, so it would have to be sent to VLC or mplayer as Pulzar said. It's not something I'm against doing, it's just not something I want to spend a lot of time on. Streaming video from non-complete rar sets has been requested in MediaPortal for quite some time and I still don't think there's a clean solution for it. I've actually already added an option to, instead of downloading it, take whatever action you've specified when clicking an NZB. This will allow you to launch nzbplayer. It's not exactly ideal, but it does work for now.
jburnette is offline   Reply With Quote
Old 2008-05-22, 01:26   #337 (permalink)
Portal Member
 
Join Date: Mar 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

Quote:
Originally Posted by jburnette View Post
Pulzar,
I certainly do appreciate the work you've done there, but I'm not exactly sure what the problem was to begin with? Newzbin works fine for me. Is that for a different listings style than v3 attrs in table? Again, though, I do appreciate the work you've done.

bazz,
Implementation of an nzbplayer like interface has definitely been discussed before, but I'm not sure it's going to happen for quite some time. I would personally never use it, but that's not really an issue as I'm more than happy to accommodate. If someone wants to do the backend work and write the unraring (from a non-complete set) routines, I'd gladly implement it in MyUsenet. g_player (MediaPortal's DirectShow player) won't play video data from a memory stream as far as I know, so it would have to be sent to VLC or mplayer as Pulzar said. It's not something I'm against doing, it's just not something I want to spend a lot of time on. Streaming video from non-complete rar sets has been requested in MediaPortal for quite some time and I still don't think there's a clean solution for it. I've actually already added an option to, instead of downloading it, take whatever action you've specified when clicking an NZB. This will allow you to launch nzbplayer. It's not exactly ideal, but it does work for now.
I'll have to have a go at trying out the idea of passing the NZB to nzbplayer. Sounds like it should work well - I just need to have a rummage to see what sort of switches nzbplayer supports. I think the way nzbplayer works at the moment is to somehow generate an .avi file (or whatever) of the correct size, then dump the correct information into the file as it's done. So if g_player supports playing broken avi files then it might be easier to implement. I can have a play at this and see what happens.

It'd be nice if MediaPortal could integrate VLC a bit more intimately; I've no idea how practical this is.
bazzz is offline   Reply With Quote
Old 2008-05-22, 15:48   #338 (permalink)
Portal Member
 
Join Date: Apr 2008
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post


Default

Quote:
Originally Posted by jburnette View Post
Pulzar,
I certainly do appreciate the work you've done there, but I'm not exactly sure what the problem was to begin with? Newzbin works fine for me. Is that for a different listings style than v3 attrs in table? Again, though, I do appreciate the work you've done.
The problem was that the html I was getting from newzbin was slightly different from what it looks like you're getting... and I'm not sure why that is. I haven't changed any reporting options/settings in newzbin (are there any?), I simply created a few custom searches and that's all.

I'm not really sure what the best way around figuring that out is. Any ideas? Do you have any custom newzbin report settings turned on?

An alternative is to use some regular expressions to look for <td\s*(colspan="3"|)\s*class="title"> so that both formats are recognized... Of course, we can't be sure that those are the only two possible formats, and that somebody else won't have yet another one .
Pulzar is offline   Reply With Quote
Old 2008-05-22, 16:00   #339 (permalink)
Portal Member
 
jburnette's Avatar
 
Join Date: Aug 2006
Location: Kentucky
Age: 23
Posts: 700
Thanks: 125
Thanked 90 Times in 49 Posts

Country:

My System

Default

I'm thinking that you may possibly be using a different listing style. There are actually 7 of them - only one of which is supported by the plugin (v3 attrs in table). In My Account -> My Preferences -> Report View Preferences you'll see the 7. I also posted a screen shot below. There have been requests in the past to support others, but it's something I really never got around to doing. Hopefully what you've posted is actually support for another listing style, but I'll wait for you to confirm that.
Attached Thumbnails
my-usenet-styles.png  
jburnette is offline   Reply With Quote
Old 2008-05-22, 16:36   #340 (permalink)
Portal Member
 
Join Date: Apr 2008
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post


Default

Ah, that makes sense. I didn't even know that there were multiple report views .

Mine is set to "Cypher (Attrs in Popup)". So, yes, it looks like my code adds support for that view. Now the question is -- can we automatically detect which view the user is using and then decode accordingly, or if this would have to be a config option... Certainly the auto-detect way would be more elegant. I wonder if there are any "clues" in the html that indicate which view is being used. I don't see anything obvious (like looking for "cypher" in HTML ), but I guess one could diff the two reports and see if there are any easily detectable elements..
Pulzar is offline   Reply With Quote
Reply

Bookmarks

Tags
nzb

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
REQ: Usenet plugin is there interest idioteque Plugins 4 2006-11-13 11:34


All times are GMT +1. The time now is 19:48.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress