My Usenet (2 Viewers)

jburnette

Portal Pro
August 24, 2006
758
116
Kentucky
Home Country
United States of America United States of America
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.
 

Pulzar

Portal Member
April 28, 2008
14
1
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:

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 :).
 

bazzz

Portal Pro
March 29, 2008
87
5
Vancouver, BC
Home Country
Canada Canada
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.
 

Pulzar

Portal Member
April 28, 2008
14
1
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!
 

jburnette

Portal Pro
August 24, 2006
758
116
Kentucky
Home Country
United States of America United States of America
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.
 

bazzz

Portal Pro
March 29, 2008
87
5
Vancouver, BC
Home Country
Canada Canada
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.
 

Pulzar

Portal Member
April 28, 2008
14
1
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 :(.
 

jburnette

Portal Pro
August 24, 2006
758
116
Kentucky
Home Country
United States of America United States of America
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.
 

Attachments

  • styles.png
    styles.png
    11 KB

Pulzar

Portal Member
April 28, 2008
14
1
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..
 

Users who are viewing this thread

Top Bottom