Author Topic: NetFlix  (Read 10869 times)

0 Members and 1 Guest are viewing this topic.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
NetFlix
« on: October 10, 2014, 05:30:16 AM »
here is a work in progress (I'd say 85%) for Netflix controlled by the mighty VC :)
commands are dynamic except for the 2 with payloads attached ...

good to know:
 - the commands will allow to browse and start playing a movie ... but no movie control yet (see below)
 - commands will require some tweaking to work:
      - must create NetFlixProfileTocken.xml, if you use profiles (never tested without profiles) ... to do that, log in to Netflix with your browser and, right click the profile and copy the shortcut ... the token is whatever after tkn=
      - see the command current page for log-in credentials ... either create the map or put directly your info ...
 - modify the enable and disable groups in ++Open NetFlix...
 - create a command outside the group to trigger NetFlix.Start, as I have the group disabled, once enabled and Netflix start I disable everything else
 - group has prefix override ...

have fun, if you find bugs please report, feedback and your experience with this, will help to improve it ...

---------------------- Original Post -----------------------------
before I reinvent the wheel, I though to check if anybody has developed a way to integrate Netflix with VC ... sadly they are stopping the public API in November 2014 ... so things must be done by manipulating the browser ...

if nobody did it yet... I think the way to go is use robobrowser ...

Idea: scrape mylist page to build xml file then one can say: I want to watch the mask ... and the mask movie starts
« Last Edit: January 28, 2015, 01:11:55 PM by Haddood »
When Voice command gets tough, use hand gestures

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: NetFlix Xml Request
« Reply #1 on: October 10, 2014, 08:05:27 AM »
The only one I remember is http://voxcommando.com/forum/index.php?topic=1034.0

But that wasn't scraping the site -- just relying on static URLs.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: NetFlix Xml Request
« Reply #2 on: October 10, 2014, 08:06:38 AM »
There are Netflix plugins for some media centres like XBMC.  You might be able to do something with that.  But you are right, roboBrowser will probably offer a lot of options.  The only problem is that it probably won't take long before Netflix changes the design and breaks it so be prepared for the occasional fixing session.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: NetFlix Xml Request
« Reply #3 on: October 10, 2014, 08:48:26 AM »
There are Netflix plugins for some media centres like XBMC.  You might be able to do something with that.  But you are right, roboBrowser will probably offer a lot of options.  The only problem is that it probably won't take long before Netflix changes the design and breaks it so be prepared for the occasional fixing session.

I tried some... the one that works with gotham in fact uses chrome browser screen ... so I might as well do it with robobrowser and have full control... for the moment the disadvantage with early tests is that VC really grows additional 60MB on memory
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: NetFlix Xml Request
« Reply #4 on: October 10, 2014, 09:26:30 AM »
the disadvantage with early tests is that VC really grows additional 60MB on memory

Is that really a problem?  60 megabytes is really nothing nowadays, and what would it cost you if you run Netflix in a separate browser?  Do you need that memory for something else?

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: NetFlix Xml Request
« Reply #5 on: October 15, 2014, 12:42:13 AM »
Is that really a problem?  60 megabytes is really nothing nowadays, and what would it cost you if you run Netflix in a separate browser?  Do you need that memory for something else?

I am running VC on a mac mini 2006 with 2.5GB ram ... it is already at 1.8Gb most of the time and windows is not fan of high meme load ...
anyway I got done at 90% ... logging, browsing ...and play are working ... needs some fine tuning then I will share ... feels like can grow to be the ultimate solution of movie library

When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: NetFlix Xml Request
« Reply #6 on: October 15, 2014, 08:13:56 AM »
... what would it cost you (in memory consumption)  if you run Netflix in a separate browser?

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: NetFlix Xml Request
« Reply #7 on: October 17, 2014, 07:45:30 PM »
now I get what you meant  :bonk :bonk
however I don't mind a browser crashing ... but it hurts when VC freeze  :biglaugh :biglaugh
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: NetFlix Xml Request
« Reply #8 on: October 18, 2014, 08:54:48 AM »
It seems we have shifted to a new topic.  I thought we were talking about memory consumption.

Does NetFlix crash your browser frequently?

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: NetFlix Xml Request
« Reply #9 on: October 18, 2014, 06:35:48 PM »
It seems we have shifted to a new topic.  I thought we were talking about memory consumption.

Does NetFlix crash your browser frequently?

not at all. but Netflix in robobrowser tends to freeze VC ...sometimes it recovers after a while sometimes it does not. I haven't reported anything yet as I am still working on the commands
When Voice command gets tough, use hand gestures

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: NetFlix
« Reply #10 on: January 28, 2015, 01:12:57 PM »
I updated the post above instead of starting a new thread ....

there is still work to be done on the Netflix commands:
- scrolling the pages ...
- in home page, limit movies playable to the lists visible on the screen
- movie controls (couldn't get sendkey or the variations to send key press to robobrowser in full screen mode (Silverlight or DX), if someone solves this please post back)
- disable subgenre and sorting for pages that do not have sorting /subgenre ...
- make sorting command dynamic, just in case things varies or they add new options ...
- add filters to sorting (like the tick boxes in sort by maturity rating)
- add and remove movies to my list
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: NetFlix
« Reply #11 on: January 28, 2015, 01:23:50 PM »
- movie controls (couldn't get sendkey or the variations to send key press to robobrowser in full screen mode (Silverlight or DX), if someone solves this please post back)
Does that mean that it works OK when not in full screen mode?

Keyboard emulate will only work if the correct window has focus.
If sendkeys does not work, try InputKeys, or DxInput (the most powerful, low level method)
In some cases keyboard emulation might work better (maybe) if you run VC as admin but normally I don't think this should be needed.

Also in the case of an activeX or flash component on a web page, the keyboard emulation might only work if the control has focus (not just the page but the actual flash control on the page) so it might be necessary to first focus the flash control.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: NetFlix
« Reply #12 on: January 28, 2015, 01:31:08 PM »
Cool Idea, I control Netflix playback, when in full screen, I'm not sure if it will work with robobrowser but this works for me using Chrome

Chrome Netflix
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<commandGroup open="True" name="Chrome Netflix" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="591" name="Netflix play/pause" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Window.Focus</cmdType>
      <params>
        <param>Chrome</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>SendKeys</cmdType>
      <params>
        <param>{ENTER}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Pause Netflix, Play Netflix</phrase>
  </command>
  <command id="588" name="Netflix Find Netflix" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Window.Focus</cmdType>
      <params>
        <param>Chrome</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Find Netflix</phrase>
  </command>
  <command id="570" name="Netflix Stop/Close" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Window.Close</cmdType>
      <params>
        <param>Chrome</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Window.Focus</cmdType>
      <params>
        <param>XBMC</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Stop Netflix, Close Netflix</phrase>
  </command>
  <command id="581" name="Netflix Step back" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>SendKeys</cmdType>
      <params>
        <param>{LEFT}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Step back, I missed that, What was that</phrase>
  </command>
  <command id="582" name="Netflix Step Forward" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>SendKeys</cmdType>
      <params>
        <param>{RIGHT}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Step Forward, Jump forward</phrase>
  </command>
  <command id="578" name="Netflix Fast Forward" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="True" loopDelay="200" loopMax="0" description="">
    <action>
      <cmdType>Window.Focus</cmdType>
      <params>
        <param>Chrome</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>InputKeys.Send</cmdType>
      <params>
        <param>vk:right</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Fast Forward Netflix</phrase>
  </command>
  <command id="602" name="Netflix Rewind" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="True" loopDelay="200" loopMax="0" description="">
    <action>
      <cmdType>Window.Focus</cmdType>
      <params>
        <param>Chrome</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>InputKeys.Send</cmdType>
      <params>
        <param>vk:left</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Rewind Netflix</phrase>
  </command>
  <command id="991" name="Netflix Frame Selection" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="True" loopDelay="500" loopMax="0" description="">
    <action>
      <cmdType>Window.Focus</cmdType>
      <params>
        <param>Chrome</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>InputKeys.Send</cmdType>
      <params>
        <param>vk:right</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Show frame Selection, Show Frames, Hide Frame Selection, Hide Frames</phrase>
  </command>
</commandGroup>

Hope this can help
« Last Edit: April 07, 2015, 01:51:17 AM by PegLegTV »

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: NetFlix
« Reply #13 on: January 28, 2015, 01:33:12 PM »
James,
I tried InputKeys and DxInput as well ... but no luck ... in fact that is why I haven't shared the command before... though I have it since more than 2 months ... now, running short on time for VC ... thought maybe others can help to finish it ...

I can't remember if my tries worked in window mode  ....

Cool Idea, I control Netflix playback, when in full screen, I'm not sure if it will work with robobrowser but this works for me using Chrome

Chrome Netflix

Hope this can help

thank you for sharing ... will test and post back ...
« Last Edit: January 28, 2015, 01:37:05 PM by Haddood »
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: NetFlix
« Reply #14 on: January 28, 2015, 02:46:46 PM »
I just signed up for Netflix (one month free), started playing a movie in robobrowser, went fullscreen (via the fullscreen button in the Silverlight player) then tested with DxInput to pause and play by emulating spacebar.  Worked perfectly on the first try.

Here's my test command for play/pause:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.6-->
<command id="212" name="begin, start, pause playback" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>DxInput.KeyPress</cmdType>
    <params>
      <param>space</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>begin, start, pause</phrase>
  <phrase>playback</phrase>
</command>

You need to enable the dxInput plugin.  Also, I set my keypress delay to 60ms.  I did not test with lower values but it might not work if you set it too low.  60 milliseconds usually works well.