Skip to content

Instantly share code, notes, and snippets.

@eyecatchup
Last active November 17, 2019 17:43
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save eyecatchup/6219118 to your computer and use it in GitHub Desktop.
Save eyecatchup/6219118 to your computer and use it in GitHub Desktop.
Instructions how to install (and run) "Leapcast" on Windows.
1. Download https://github.com/dz0ny/leapcast/archive/master.zip
2. Extract zip to C:\leapcast
3.1 Download Python 2.7:
x86: http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi
x64: http://www.python.org/ftp/python/2.7.5/python-2.7.5.amd64.msi
3.2 Install Python to C:\Python27
NOTE: If you have a newer version, install 2.7.5 and edit the environment variable and change for example "C:\Python33" to "C:\Python27".
4.1 Download Setuptools here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools
x86: setuptools-0.9.8.win32-py2.7.exe
x64: setuptools-0.9.8.win-amd64-py2.7.exe
4.2 Install Setuptools to path suggested by installer (should be C:\Python27\Lib\site-packages\)
5.1 Download Pip here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip
x86: pip-1.4.1.win32-py2.7.exe
x64: pip-1.4.1.win-amd64-py2.7.exe
5.2 Install Pip to path suggested by installer (should be C:\Python27\Lib\site-packages\)
__Update__ As of version 0.0.2 Twisted is no longer required. If you don't use 0.0.1, skip to step 7.
6.1 Download Twisted here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
x86: Twisted-13.1.0.win32-py2.7.exe
x64: Twisted-13.1.0.win-amd64-py2.7.exe
6.2 Install Twisted to path suggested by installer (should be C:\Python27\Lib\site-packages\)
7. Edit "PATH" environment variable (under "system variables") to include separate "C:\Python27\Scripts" using ; to separate them.
8. Press "Windows" + "r" keys (or Start > Run), type "powershell" (without quotation marks) and hit Enter.
9. Type
cd C:\leapcast
10. Type
python setup.py develop
11. If succeded, you'll get a message that leapcast was added to "C:\Python27\Scripts".
12. To start leapcast, type
x86: leapcast --name Name-Of-Device --chrome 'C:\\PROGRA~1\\Google\\Chrome\\Application\\chrome.exe' --fullscreen
x64: leapcast --name Name-Of-Device --chrome 'C:\\PROGRA~2\\Google\\Chrome\\Application\\chrome.exe' --fullscreen
Update: For simplicity I added a VBScript. On double-click it will open a command prompt (in minimized window mode) and executes the command to start the Leapcast app.
# A quick video demo is available here: http://www.youtube.com/watch?v=n1wLy1LQV_g
' Start Leapcast (https://github.com/dz0ny/leapcast/) with a double-click.
'
' Save this VBScript as "start-leapcast.vbs" somewhere on your Windows PC.
' Now double-click it to start Leapcast (command prompt will be minimized
' by default). More info here: https://gist.github.com/eyecatchup/6219118
Set WshShell = WScript.CreateObject("WScript.Shell")
' The display name for the emulated Chromecast.
DeviceName = "Leapcast"
' NOTE: In case you edit the paths to the leapcast.exe & chrome.exe files
' below, you should use '\\' (double-backslash) to separate the pathnames.
' More info here: http://docs.python.org/2/library/os.html#os.sep
'
' If in pathname, replace "Program Files" with "PROGRA~1".
' If in pathname, replace "Program Files (x86)" with "PROGRA~2".
' The absolute path to the leapcast.exe file.
LeapcastExeAbsPath = "C:\\Python27\\Scripts\\leapcast.exe"
' The absolute path to the chrome.exe file.
ChromeExeAbsPath = "C:\\PROGRA~2\\Google\\Chrome\\Application\\chrome.exe"
' Do not edit below this line unless you know what you are doing!
Cmd = LeapcastExeAbsPath & " --name " & DeviceName & " --chrome "
Cmd = Cmd & ChromeExeAbsPath & " --fullscreen"
' The second parameter on WshShell.Run() is the intWindowStyle. A value of
' "7" tells it to open the command prompt as a minimized window & that the
' active window remains active. To change the default window display style
' checkout the docs: http://msdn.microsoft.com/en-us/library/d5fk67ky.aspx
Return = WshShell.Run(Cmd, 7, True)
Set WshShell = Nothing
@SpiderSprog
Copy link

Hi could you clarify where the edit in step 7 is needed please?

Also when I run the command in step 10 I get an error saying there is no setuptools module despite having installed it in the correct location.
is this due to not making the step 7 edit?

Edit:: ok I found where I need to make the edit thanks to this page

http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7

but I'm still getting the same error

@eyecatchup
Copy link
Author

@SpiderSprog There're several answers in the linked SO thread. Please make sure that you did not added a "PYTHONPATH", but instead added the Paths to the "PATH" variable. See this answer: http://stackoverflow.com/a/17176423/624466

When you add "C:\Python27\Scripts" also make sure to not use a trailing slash (like "C:\Python27\Scripts").
Furthermore, note that you must restart the console, before the changes in your PATH variable will take effect.

If you still have issues, please provide some more details (System architecture, Python version etc, Install paths).

Cheers

@SpiderSprog
Copy link

OK with some more help from the following site

http://pastebin.com/5SDW1cak

I managed to get it to install but when I use the command to run it
I get a socket error 10048 (only one usage of each socket is permitted)
I thought this might be down to having 2 python installations ( I had 2.6 too) so i Un-installed everything python related and followed the steps from the above link, and I'm still hitting the 10048.

I'm installing on x86 win7 python 2.7.5, my last attempt at installing I followed the instructions in the linked PasteBin exactly

Any ideas (thanks for your help so far )

P.S. I think the original problem was down to having a reference to python26 in the path variables that appeared before the python27 and python27\scripts, I fixed that too by deleting the python26 one

@SpiderSprog
Copy link

Well I feel like a bit if an idiot but disabling my antivrus seems to have done the trick. doh!

@therealbiglou
Copy link

I was receiving the same 100048 socket error. However, disabling my antivirus still did not correct the issue. Do you know of a fix for this problem?

@arcao
Copy link

arcao commented Aug 16, 2013

Note: Parameters to start leapcast should be

x86: leapcast --name Name-Of-Device --chrome "c:\Program Files\Google\Chrome\Application\chrome.exe" --fullscreen
x64: leapcast --name Name-Of-Device --chrome "c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --fullscreen

@eyecatchup
Copy link
Author

@arcao Thanks. I just wrote it down as I used it myself. Anyway, I updated the Gist to use Windows pathname separators instead of POSIX (as per Specs, I used double backslashes though).
But what's the problem with SFNs?

@tripleA-A-A
Copy link

The server just hangs on starting Leapserver Windows 7x64 any ideas?

@Mune03
Copy link

Mune03 commented Jan 4, 2014

Some of the "http://www.lfd.uci.edu/" url are no longer working.

@danbush
Copy link

danbush commented Jan 14, 2014

Okay... so when the UAC popped up I accidentally said no. and so it doesn't seem to work and i am assuming that is why. The last thing the cmd says is it adding apps. Is this expected behavior?

@dinobud
Copy link

dinobud commented Jan 14, 2014

I never got a UAC but I did allow through Windows Firewall and I see nothing in the YouTube or Google Music app. After starting leapcast the last line says "INFO:root:Added Fling app" and doesn't proceed further. I suppose it isn't finished loading? On Windows 8.1 x64.

@danbush
Copy link

danbush commented Jan 14, 2014

@dinobud yeah apparently that is what I missed, not a UAC.
After adding python to windows firewall I can get it to work great with youtube. Is it correct that netflix doesnt yet work? Otherwise it seems to work great for me.
@dinobud I'll try out google music to see if that works for me, but the fling app is the last thing mine shows as well. (until you start sending it videos and such)

@derekantrican
Copy link

Is there a way to change which monitor it "casts" to?

@therealbiglou
Copy link

Is there a way to get leapcast to open above all windows including fullscreen Windows Media Center? I was hoping to run this on my HTPC, but when I cast to it, it opens behind WMC.

@krueger80
Copy link

Hey would it be more convenient to open every apps in the same browser window? As soon as you change from one application to another the previous one will never get on top by itself.
This is a great project!! As soon as my idea get implemented I will use it. I already use youtube.com/leanback to watch Youtube on my TV. I always wanted to be able to play everything, not just Youtube!
And +1 for derekantrican idea too.
Thanks

Copy link

ghost commented Feb 17, 2014

I am not able to open it at all the command is stuck at "INFO:toor:Added Fling app"

ANY HELP??

@namangupta111
Copy link

I am getting the MAXREPEAT Error.. Please help me out http://imgur.com/xiKvf9U

@taigrr
Copy link

taigrr commented May 19, 2015

I followed the instructions almost exactly. The setup tools packages have been replaced with .whl files, so I installed pip first and then ran pip install . I already had the newest version of twisted installed.

I got socket error 10048. I do not have antivirus of any kind (don't need it.)

Help?

@MythodeaLoL
Copy link

dont work

@shahriar-shojib
Copy link

Facing this problem need a workaround.
Thanks
C:\Python27\Scripts>leapcast --name Name-Of-Device --chrome "c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --fullscreen
INFO:root:Starting SSDP server
INFO:root:Starting LEAP server
INFO:root:Loading Config-JSON from Google-Server
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): clients3.google.com
Traceback (most recent call last):
File "C:\Python27\Scripts\leapcast-script.py", line 9, in
load_entry_point('Leapcast', 'console_scripts', 'leapcast')()
File "c:\users\shahriar shojib\desktop\leapcast-master\leapcast__main__.py", line 38, in main
leap_server.start()
File "c:\users\shahriar shojib\desktop\leapcast-master\leapcast\services\leap.py", line 35, in start
resp = requests.get(url=app_dict_url)
File "C:\Python27\lib\site-packages\requests-2.9.1-py2.7.egg\requests\api.py", line 67, in get
return request('get', url, params=params, *_kwargs)
File "C:\Python27\lib\site-packages\requests-2.9.1-py2.7.egg\requests\api.py", line 53, in request
return session.request(method=method, url=url, *_kwargs)
File "C:\Python27\lib\site-packages\requests-2.9.1-py2.7.egg\requests\sessions.py", line 468, in request
resp = self.send(prep, *_send_kwargs)
File "C:\Python27\lib\site-packages\requests-2.9.1-py2.7.egg\requests\sessions.py", line 576, in send
r = adapter.send(request, *_kwargs)
File "C:\Python27\lib\site-packages\requests-2.9.1-py2.7.egg\requests\adapters.py", line 447, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

@theol0403
Copy link

I have almost the same problem as shahriar-shojib. If you could help me that would be great. Thanks.
C:\Users\theol0403\leapcast>leapcast --name Name-Of-Device --chrome "c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --fullscreen
INFO:root:Starting SSDP server
INFO:root:Starting LEAP server
INFO:root:Loading Config-JSON from Google-Server
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): clients3.google.com
C:\Python27\lib\site-packages\requests-2.10.0-py2.7.egg\requests\packages\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
C:\Python27\lib\site-packages\requests-2.10.0-py2.7.egg\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Traceback (most recent call last):
File "C:\Python27\Scripts\leapcast-script.py", line 9, in
load_entry_point('Leapcast==0.1.3', 'console_scripts', 'leapcast')()
File "C:\Python27\lib\site-packages\leapcast-0.1.3-py2.7.egg\leapcast__main__.py", line 38, in main
leap_server.start()
File "C:\Python27\lib\site-packages\leapcast-0.1.3-py2.7.egg\leapcast\services\leap.py", line 35, in start
resp = requests.get(url=app_dict_url)
File "C:\Python27\lib\site-packages\requests-2.10.0-py2.7.egg\requests\api.py", line 71, in get
return request('get', url, params=params, *_kwargs)
File "C:\Python27\lib\site-packages\requests-2.10.0-py2.7.egg\requests\api.py", line 57, in request
return session.request(method=method, url=url, *_kwargs)
File "C:\Python27\lib\site-packages\requests-2.10.0-py2.7.egg\requests\sessions.py", line 475, in request
resp = self.send(prep, *_send_kwargs)
File "C:\Python27\lib\site-packages\requests-2.10.0-py2.7.egg\requests\sessions.py", line 585, in send
r = adapter.send(request, *_kwargs)
File "C:\Python27\lib\site-packages\requests-2.10.0-py2.7.egg\requests\adapters.py", line 477, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

@antisanv
Copy link

python setup.py
developDirectory '.' is not installable. File 'setup.py' not found.

@d3xd3x
Copy link

d3xd3x commented Jan 10, 2018

This is quite old but I will give it a go. Tried to install this last night but with no luck.
When I try to run .exe I am getting :

C:\Users\d3x\Desktop\LeapcastForWindows\leapcast>leapcast --name Leapcast --chrome "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --fullscreen
INFO:root:Starting SSDP server
INFO:root:Starting LEAP server
INFO:root:Loading Config-JSON from Google-Server
Traceback (most recent call last):
File "C:\Python27\Scripts\leapcast-script.py", line 9, in
load_entry_point('Leapcast==0.1.3', 'console_scripts', 'leapcast')()
File "c:\leapcast\leapcast_main_.py", line 38, in main
leap_server.start()
File "c:\leapcast\leapcast\services\leap.py", line 35, in start
resp = requests.get(url=app_dict_url)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='clients3.google.com', port=443): Max retries exceeded with url: /cast/chromecast/device/config (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),))

I used those BAT files to install everything as it is hard to find them on the web:

https://forum.xda-developers.com/showthread.php?s=32d452f64264cd1fa69c148446427cc6&t=2776621

Also had to update Python to 2.7.9 for the ssl support

Copy link

ghost commented Nov 17, 2019

Some files to download for step 4.1 cant be found anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment