NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 49 50 51 52 53 … 93 Next »
CNN Video Plugin

 
  • 0 Vote(s) - 0 Average
CNN Video Plugin
HTPCGB
Offline

Member

Posts: 215
Threads: 15
Joined: Jun 2006
#11
2006-08-02, 01:12 PM
Thanks Elite!

Now I have all the info I need to build this plugin, but there's one issue; a legal one. This method also gives access to the "CNN pipeline" (a subscription service) videos. This will require some extra coding to prevent users from accessing those videos.


This is how I'm planning it out now:
-when GBPVR loads, the scraper will be called. It will fill several arrays (one for each section) with the video links and the names of the videos.
-when the user selects a video, a form will appear behind GBPVR, buffer the content and then go fullscreen, the form automatically exits when the video finishes

Sounds simple, but it's going to be a real challenge/learning opportunity for me.

Thanks for all your help,
HTPCGB
elite
Offline

Senior Member

Posts: 700
Threads: 26
Joined: Sep 2004
#12
2006-08-02, 02:16 PM
Glad I could help out - Can't wait for the BBC patch Wink

HTPCGB Wrote:Now I have all the info I need to build this plugin, but there's one issue; a legal one. This method also gives access to the "CNN pipeline" (a subscription service) videos. This will require some extra coding to prevent users from accessing those videos.

Not sure if I'm following you right:

Do you mean that the security on the CNN site is so poor that you can access content reserved for paying subscription users if you just bypass the Javascript - I would be tempted to suggest that it is their responsibility to secure the content if they so wish, you are just accessing data which they are making available on a public url - The main reason I've never bothered to learn a client side language is that you can never be sure if the user even has it enabled - hence serverside is always the way to go for security[/ramble]

HTPCGB Wrote:This is how I'm planning it out now:
-when GBPVR loads, the scraper will be called. It will fill several arrays (one for each section) with the video links and the names of the videos.

I don't know how frequently new videos are added (faily often I would guess) - I think fetching urls periodically (every hour?) might be better. I have my dedicated pvr on 24x7 - with GBPVR loaded, so reloading it to refresh the urls would be a PITA - you could expand this to provide a ticker of new content...

HTPCGB Wrote:Sounds simple, but it's going to be a real challenge/learning opportunity for me.

Good luck - Any questions I'm sure everyone will try and help out...
Alternative music reviews[URL="http://soundblab.com"]
[/URL]
HTPCGB
Offline

Member

Posts: 215
Threads: 15
Joined: Jun 2006
#13
2006-08-02, 03:36 PM
elite Wrote:Glad I could help out - Can't wait for the BBC patch Wink
Not sure if I'm following you right:

Do you mean that the security on the CNN site is so poor that you can access content reserved for paying subscription users if you just bypass the Javascript - I would be tempted to suggest that it is their responsibility to secure the content if they so wish, you are just accessing data which they are making available on a public url - The main reason I've never bothered to learn a client side language is that you can never be sure if the user even has it enabled - hence serverside is always the way to go for security[/ramble]

Yes, you are following me right. The premium content is widely open to the public if you bypass the javascript. I would agree that if you leave content available publically, anyone has the right to access it. (However, I wouldn't want to try and prove that in court against a team of highly payed lawyers.)

Quote:I don't know how frequently new videos are added (faily often I would guess) - I think fetching urls periodically (every hour?) might be better. I have my dedicated pvr on 24x7 - with GBPVR loaded, so reloading it to refresh the urls would be a PITA - you could expand this to provide a ticker of new content...

An update button/configurable update timer is in call for. And possibly even a .xml file to store the URL's instead of a temporary array. (I'll finish the basic plugin first and add this functionality after.)



Quote:Good luck - Any questions I'm sure everyone will try and help out...

Thanks, I'll need it.
elite
Offline

Senior Member

Posts: 700
Threads: 26
Joined: Sep 2004
#14
2006-08-02, 03:47 PM
HTPCGB Wrote:Yes, you are following me right. The premium content is widely open to the public if you bypass the javascript. I would agree that if you leave content available publically, anyone has the right to access it. (However, I wouldn't want to try and prove that in court against a team of highly payed lawyers.)

Good point!
Alternative music reviews[URL="http://soundblab.com"]
[/URL]
HTPCGB
Offline

Member

Posts: 215
Threads: 15
Joined: Jun 2006
#15
2006-08-04, 12:01 AM
Right now I'm researching Regular Expressions for the scraper portion of this plugin. I've pretty much completed the media player form aspect yesterday thanks to Elite Smile .

I've decided that (for now) the scraper will be called by: 1. entering the plugin, and by 2. an update button within the plugin

For now, a few arrays will be used to store the URLs but eventually a single .xml file will be used. (The scraping is quite fast but downloading takes a second per page :eek: . Thus, having a cached local copy is preferable.)
boohiss
Offline

Junior Member

Posts: 30
Threads: 11
Joined: Apr 2006
#16
2006-08-04, 06:20 PM
HTPCGB Wrote:The Web Browser Object:

I have made a second form with a web browser object on it. The web browser is currently hard coded to go to the above URL (the second one). The web browser has been sized so only the video is displayed. When the web browser is double clicked (and hence the embedded .wmv), it goes full screen.

If I could programattically "double click" the web browser when the form loads, this would be the ideal way to go as it would eliminate the need to sift through javascript. Does anyone know how to do this?

Screenshots are coming soon.

You can change the size of the web browser window, which is what I've done for my YouTube plugin. Here's the code for the _Load event:

Code:
private void frmShowYoutube_Load(object sender, EventArgs e)
        {
            // set the webbrowser object to use the URL that was passed
            webYouTube.Url = new Uri(SelectedURL);

            // full screen maximized, no border
            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;

            // make the youtube picture as large as the form
            // (plus some extra to move the youtube scroller thing off screen
            webYouTube.Width = this.Width;
            webYouTube.Height = this.Height;

            // position the youtube picture in the top left
            webYouTube.Left = 0;
            webYouTube.Top = 0;
        }

That works perfectly for me.
HTPCGB
Offline

Member

Posts: 215
Threads: 15
Joined: Jun 2006
#17
2006-08-08, 01:16 AM
Thanks boohiss, I've implemented your tip on the media player object so the user never sees a "form" form.


I've done very little this past weekend but I've managed to find a regex that works quickly and properly (ignores CNN pipeline videos).

Here it is in case anyone's curious:
Quote:<a\shref="javascript:cnnPlayVideo[(]'([A-Za-z0-9.,!?://...]*)'[)];"><img\sborder="0"\salt=""\sheight="13"\swidth="21"\ssrc="http://i.a.cnn.net/cnn/.element/img/1.3/video/broadband/brws.srch/play_btn_brws.gif"></a><b><a\shref="javascript:cnnPlayVideo[(]'[A-Za-z0-9.,!?://...]*'[)];">([A-Za-z0-9;:,.-]*\s{0,1}){1,9}</a>

Now, I'm going to finish up the media player form before I proceed. It needs to be finished in the following areas:

-a "Video Buffering" graphic that is displayed over the mediaplayer object so you aren't looking at a black screen thinking "huh!". The problem: any text that is drawn sits behind the media player object. How would I bring it to the front?

-response to remote control/keyboard presses (back/exit or ESC, play/pause or Enter)


After that's done, all that will be left is capturing the URL's into arrays and the daunting task of making the interface.

Thanks for your continued help,
HTPCGB
boohiss
Offline

Junior Member

Posts: 30
Threads: 11
Joined: Apr 2006
#18
2006-08-10, 02:20 PM
I didn't use RegEx to scrape the URL I need from YouTube, I just used a couple strings to cut before and cut after the source code that I need.

I'm wondering if your method is any faster, and I'm also wondering what objects/methods you are using to grab the source in the first place.
HTPCGB
Offline

Member

Posts: 215
Threads: 15
Joined: Jun 2006
#19
2006-08-10, 04:34 PM
The scraping itself takes no more than a second. (Unless it's a really big page.) It's downloading the page which kills the time.


To grab the source I use the following:

Quote:private void theScraper(string theURL)
{
HttpWebRequest theRequest;
HttpWebResponse theResponse;
Stream theStream;

// set the URL to be requested
theRequest = (HttpWebRequest)WebRequest.Create(theURL);
// exeption handling needed

// get the response
theResponse = (HttpWebResponse)theRequest.GetResponse();

// put the reponse into a stream
theStream = theResponse.GetResponseStream();

// put the HTML into a string
string theSourceCode = new StreamReader(theStream).ReadToEnd();

Sytem.Net and System.IO are needed references for the above.

If you want the entire source, I'd be glad to provide it.


Now a question to you about GBPVRUIElements. How hard would it be to display one "column" of a 2D array in a list element and then return the user selected position of the array? Would there be an easier way to do this in your opinion?
HTPCGB
Offline

Member

Posts: 215
Threads: 15
Joined: Jun 2006
#20
2006-08-14, 04:17 PM
Update: I finished the scraper last night so I can now move on to the tough part, the UI. I also took a look at the bbc site. It is quite a bit more complex than CNN but that isn't the issue. Here's the problem:

Quote:Copyright Notice
All rights, including copyright, in the content of these BBC web pages are owned or controlled for these purposes by the BBC.
In accessing the BBC's web pages, you agree that you may only download the content for your own personal non-commercial use.

You are not permitted to copy, broadcast, download, store (in any medium), transmit, show or play in public, adapt or change in any way the content of these BBC web pages for any other purpose whatsoever without the prior written permission of the BBC.

I'm most concerned about the "adapt or change in any way the content" portion. I wouldn't be "changing" the content in any way but the video portions would be "adapted" for the plugin. The solution is obvious, I will have to contact BBC...

Anyways, here's the updated outline for the plugin:
-when the user selects an update button, several pages will be downloaded and scraped, then an array for each news section will be filled with Title and Url info
-the user will select a section and the associated array's contents will be shown in a list element
-the position in the array that was selected will be returned and the url will be passed to the media player form
-the mediaplayer form will close when the stream is ended

If everything goes fine (I don't watch TV all day like I did this past week), expect a proof of concept around tuesday-wednesday and a beta around thursday-friday.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (5): « Previous 1 2 3 4 5 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 3,106 2022-10-17, 12:44 AM
Last Post: sgilani
  Video streaming URL and parameters? cncb 1 1,956 2021-10-22, 06:58 PM
Last Post: sub
  Extras device - using hardware video encoder gdogg371 6 3,437 2021-03-09, 12:18 AM
Last Post: gdogg371
  Loading Local Video Files Syler 25 7,063 2021-03-07, 09:20 PM
Last Post: Syler
  New Systems Plugin kirschey 10 3,577 2020-11-14, 08:01 PM
Last Post: sub
  Resuming a video imilne 28 15,159 2016-10-30, 09:27 PM
Last Post: mvallevand
  How to tell when video playback has finished in web client? cncb 6 4,408 2015-09-29, 08:07 PM
Last Post: cncb
  VIdeo playback from plugin mvallevand 5 3,655 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 3,019 2014-11-14, 02:05 AM
Last Post: Benoire
  Inset Video - Stop mvallevand 2 2,158 2013-08-07, 09:57 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode