jinxo13 / FetchTV-Helpers

Useful tools for FetchTV
GNU General Public License v3.0
11 stars 3 forks source link

newbie question re ModuleNotFoundError: No module named 'jsonpickle' #1

Closed hydra3333 closed 3 years ago

hydra3333 commented 4 years ago

Hello. Newbie alert.

I just installed x64 python 3.8.6 on Win10x64.

then I did

python C:\SOFTWARE\FetchTV_Helper\fetchtv_upnp.py --help

and saw

Traceback (most recent call last):
  File "C:\SOFTWARE\FetchTV_Helper\fetchtv_upnp.py", line 13, in <module>
    import jsonpickle
ModuleNotFoundError: No module named 'jsonpickle'

Suggestions would be welcomed.

hydra3333 commented 4 years ago

Ah. After

pip3 install jsonpickle

this worked.

python C:\SOFTWARE\FetchTV_Helper\fetchtv_upnp.py --help
hydra3333 commented 4 years ago

Oh dear.

python C:\SOFTWARE\FetchTV_Helper\fetchtv_upnp.py --info
[+] Started: 2020-09-27 16:04:31
[+] Discover Fetch UPnP location:
        ERROR: Unable to locate Fetch UPNP service
[+] Discovery failed

The TV can see the 2x Fetch Mighty's though. So can Windows 10.

mesh-newbie commented 4 years ago

@hydra3333 check to see that your PC can see the fetch box. You can quickly check using your browser. http://:49152/MediaServer.xml

Which will show something like this `

1 0 urn:schemas-upnp-org:device:MediaServer:1 STB 10.0.0.5 Fetch Technologies Co., Ltd http://www.fetch.com/ DLNA1.5 MediaServer Fetch DLNA1.5 DMS 1 http://www.fetch.com/ presentation.html image/jpeg 0 0 24 /DMS_LOGO.jpg urn:schemas-upnp-org:service:ContentDirectory:1 urn:upnp-org:serviceId:ContentDirectory /web/cds.xml /web/cds_control /web/cds_event urn:schemas-upnp-org:service:ConnectionManager:1 urn:upnp-org:serviceId:ConnectionManager /web/cms.xml /web/cms_control /web/cms_event `
hydra3333 commented 4 years ago

Yes, Chrome can see both of them, eg here's one (ip and uuid removed):

<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>
<friendlyName>STB xx.xx.xx.xx</friendlyName>
<manufacturer>Fetch Technologies Co., Ltd</manufacturer>
<manufacturerURL>http://www.fetch.com/</manufacturerURL>
<modelDescription>DLNA1.5 MediaServer</modelDescription>
<modelName>Fetch DLNA1.5 DMS</modelName>
<modelNumber>1</modelNumber>
<modelURL>http://www.fetch.com/</modelURL>
<serialNumber>001</serialNumber>
<UDN>uuid:a-big-string</UDN>
<presentationURL>presentation.html</presentationURL>
<iconList>
<icon>
<mimetype>image/jpeg</mimetype>
<width>0</width>
<height>0</height>
<depth>24</depth>
<url>/DMS_LOGO.jpg</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>
<SCPDURL>/web/cds.xml</SCPDURL>
<controlURL>/web/cds_control</controlURL>
<eventSubURL>/web/cds_event</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<SCPDURL>/web/cms.xml</SCPDURL>
<controlURL>/web/cms_control</controlURL>
<eventSubURL>/web/cms_event</eventSubURL>
</service>
</serviceList>
</device>
</root>
mesh-newbie commented 4 years ago

@hydra3333 try (using your ip and port #) python ./fetchtv_upnp.py --ip=10.0.0.5 --port=49152 --info I'm on a mac. Perhaps the discovery pnp/socket works differently on a pc? ` ssdpDiscover = ('M-SEARCH * HTTP/1.1\r\n' + 'HOST: 239.255.255.250:1900\r\n' + 'MAN: "ssdp:discover"\r\n' + 'MX: 1\r\n' + 'ST: ssdp:all\r\n' + '\r\n')

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.sendto(ssdpDiscover.encode('ASCII'), ("239.255.255.250", 1900))
sock.settimeout(DISCOVERY_TIMEOUT)

`

hydra3333 commented 4 years ago

OK. Works if specify the IP.
Shaping up to look like ssdp discovery works in windows Network, but not in this python script. ?

C:\SOFTWARE\FetchTV_Helper>python .\fetchtv_upnp.py --ip=10.0.0.21 --port=49152 --info
[+] Started: 2020-09-29 14:44:20
[+] Discover Fetch UPnP location:
[+] Discovery successful: http://10.0.0.21:49152/MediaServer.xml
{'deviceType': 'urn:schemas-upnp-org:device:MediaServer:1',
 'friendlyName': 'STB 10.0.0.21',
 'manufacturer': 'Fetch Technologies Co., Ltd',
 'manufacturerURL': 'http://www.fetch.com/',
 'modelDescription': 'DLNA1.5 MediaServer',
 'modelName': 'Fetch DLNA1.5 DMS',
 'modelNumber': '1',
 'url': 'http://10.0.0.21:49152/MediaServer.xml'}
[+] Done: 2020-09-29 14:44:20

C:\SOFTWARE\FetchTV_Helper>python .\fetchtv_upnp.py --ip=10.0.0.22 --port=49152 --info
[+] Started: 2020-09-29 14:44:42
[+] Discover Fetch UPnP location:
[+] Discovery successful: http://10.0.0.22:49152/MediaServer.xml
{'deviceType': 'urn:schemas-upnp-org:device:MediaServer:1',
 'friendlyName': 'STB 10.0.0.22',
 'manufacturer': 'Fetch Technologies Co., Ltd',
 'manufacturerURL': 'http://www.fetch.com/',
 'modelDescription': 'DLNA1.5 MediaServer',
 'modelName': 'Fetch DLNA1.5 DMS',
 'modelNumber': '1',
 'url': 'http://10.0.0.22:49152/MediaServer.xml'}
[+] Done: 2020-09-29 14:44:42

C:\SOFTWARE\FetchTV_Helper>python .\fetchtv_upnp.py  --info
[+] Started: 2020-09-29 14:44:52
[+] Discover Fetch UPnP location:
                function discover_pnp_locations socket error exception, socket closed
        ERROR: Unable to locate Fetch UPNP service
[+] Discovery failed

(the extra debug statement added by me)

hydra3333 commented 4 years ago

fyi

python C:\SOFTWARE\FetchTV_Helper\fetchtv_upnp.py --ip=10.0.0.22 --port=49152 --recordings

does works to list recordings from the specified box. Thanks !

jinxo13 commented 3 years ago

I've added a requirements.txt document that includes all dependencies.