still no success with twisted 15 in windows10 and python 2.7
but still need important dependency service_identiy for valid certificate to confirm not working
Edited by mfaraj57, 1 October 2017 - 22:03.
Posted 2 October 2017 - 14:05
After further testing and downloading images by twisted web i discovered that not all https have problem
as example this image downloaded successfully without disabling certificate
https://www.vidics.to/static/90/1/Casper-12641.JPEG
as follow
def downloadimage(self, localfile, webfile, index): image_url='https://www.vidics.to/static/90/1/Casper-12641.JPEG' webfile=image_url print "image_url--twested",image_url print "ssl verivication enabled--twisted" from twisted.web import client client.downloadPage(webfile, localfile).addCallback(self.downloadback, index, localfile).addErrback(self.downloaderror, index) 11:20:10.3652 { } Plugins/Extensions/TSmedia/screens/addonshow.py:733 downloadimage image_url--twsied https://www.vidics.to/static/90/1/Casper-12641.JPEG 11:20:10.3656 { } Plugins/Extensions/TSmedia/screens/addonshow.py:734 downloadimage ssl verivication enabled--twsited 11:20:11.8874 { } Plugins/Extensions/TSmedia/screens/addonshow.py:740 downloadback success-twisteded
but still ssl.handshake problem for all images from same sever
def downloadimage(self, localfile, webfile, index): image_url='https://www.almstba.tv/video/uploads/thumbs/936acfcba-1.jpg' webfile=image_url print "image_url--twsied",image_url print "ssl verivication enabled--twsited" from twisted.internet import _sslverify _sslverify.platformTrust = lambda : None from twisted.web import client client.downloadPage(webfile, localfile).addCallback(self.downloadback, index, localfile).addErrback(self.downloaderror, index) 11:39:35.6861 { } Plugins/Extensions/TSmedia/screens/addonshow.py:734 downloadimage ssl verivication enabled--twsited 11:39:35.6941 { } Plugins/Extensions/TSmedia/screens/addonshow.py:733 downloadimage image_url--twsied https://www.almstba.tv/video/uploads/thumbs/936acfcba-1.jpg 11:39:35.6946 { } Plugins/Extensions/TSmedia/screens/addonshow.py:734 downloadimage ssl verivication enabled--twsited libpng warning: iCCP: known incorrect sRGB profile 11:39:36.0782 { E } Plugins/Extensions/TSmedia/screens/addonshow.py:748 downloaderror error-twsied [Failure instance: Traceback: <class 'OpenSSL.SSL.Error'>: [('SSL routines', 'SSL23_GET_SERVER_HELLO', 'sslv3 alert handshake failure')] /usr/lib/enigma2/python/e2reactor.py:184:_doReadOrWrite
Now the problem is limited to some secure links and not to all while these can be downloaded by other methods like requests we consider it is bug in twisted web in managing handshake error,at least with version 13 which used with our stbs.
Now upgrading to 14 or to latest 17 could solve this minor problem but things will be not easyif possible as i discovered from trying to install version 17 of twisted web ,that it is different,more complex, a lot of features mostly not required to stb,s as well as a series of dependent files some of them will not be suitable for stb,s.
Edited by mfaraj57, 2 October 2017 - 14:06.
Posted 2 October 2017 - 18:10
webfile https://images.beinsports.com/ET-AeOHhPzFkeIJfq8oS4s5lbY8=/410x260/smart/harrykane-cropped_ama3i49599ly1r0yxio9ds5xm.jpg 19:05:33.8940 { } Plugins/Extensions/TSmedia/screens/addonshow.py:709 newPage localfile /tmp/TSmedia/harrykane-cropped_ama3i49599ly1r0yxio9ds5xm.jpg 19:05:34.3735 { E } Plugins/Extensions/TSmedia/screens/addonshow.py:742 downloaderror [Failure instance: Traceback: <class 'OpenSSL.SSL.Error'>: [('SSL routines', 'SSL23_GET_SERVER_HELLO', 'sslv3 alert handshake failure')]
Posted 2 October 2017 - 18:16
Posted 2 October 2017 - 18:27
SNI is used by virtually all webservers today, nobody has IP's per webserver spare, or is willing to use them up for such an excuse.
Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Pro (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)
Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.
Many answers to your question can be found in our new and improved wiki.
Posted 2 October 2017 - 19:49
Posted 2 October 2017 - 21:19
import os from OpenSSL import SSL from twisted.web import client from twisted.internet import ssl, reactor from twisted.internet._sslverify import ClientTLSOptions class SNIFactory(ssl.ClientContextFactory): def __init__(self, hostname = None): self.hostname = hostname def getContext(self): ctx = self._contextFactory(self.method) if self.hostname: ClientTLSOptions(self.hostname, ctx) return ctx image_url="https://www.almstba.tv/video/uploads/thumbs/718173fd7-1.jpg" localfile="/tmp/image.jpg" def downloadback(data): print 'download success' reactor.stop() def downloaderror(data): print "error_data",data reactor.stop() sniFactory = SNIFactory('www.almstba.tv') print "downloading image by twisted web..." client.downloadPage(image_url, localfile, sniFactory).addCallback(downloadback).addErrback(downloaderror) reactor.run() print localfile, "exists", os.path.exists(localfile)Above works for me...
# python testW.py downloading image by twisted web... download success /tmp/image.jpg exists True # md5sum /tmp/image.jpg 754448d51d9faf113e7ee0037af5b8b4 /tmp/image.jpgIn order to get there I had to:
python-attrs_17.2.0-r0_mips32el.ipk python-constantly_15.1.0-r0_mips32el.ipk python-incremental_17.5.0-r0_mips32el.ipk python-pyasn1-modules_0.1.4-r0_mips32el.ipk python-pyasn1_0.3.6-r0_mips32el.ipk python-service-identity_17.0.0-r0_mips32el.ipk python-twisted-core_17.9.0-r0_mips32el.ipk python-twisted-protocols_17.9.0-r0_mips32el.ipk python-twisted-web_17.9.0-r0_mips32el.ipkUpdate recipe for twisted to 17.9.0
Posted 17 July 2018 - 14:15
oe-a (openatv) made a patch with a newer twistedweb in 2016... but they never 'pushed' it to openembeded... They just forked and then patched their openembeded environment.
Now rocko and sumo have even a more modern twistedweb... So we must have some patience here...
(see also the threads about serienstreamer plugin)
Edited by littlesat, 17 July 2018 - 14:17.
WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W
Posted 17 July 2018 - 19:50
So you (both) know what to do
* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.
0 members, 0 guests, 0 anonymous users