Difference between revisions of "Stream Scene Share"
From kunz
Views
Actions
Namespaces
Variants
Tools
(Created page with "<syntaxhighlight lang='python'> import re, urlopen url = 'http://hip.johnkunz.com/ttv/' html = urllib.request.urlopen(url).read() hip = sorted( re.findall(r'href=[\'"]?([^\'"...") |
|||
Line 11: | Line 11: | ||
url = 'http://hip.johnkunz.com/ttv/' | url = 'http://hip.johnkunz.com/ttv/' | ||
html = urllib2.urlopen(url).read() | html = urllib2.urlopen(url).read() | ||
hip = sorted( re.findall(r'href=[\'"]?([^\'" >]+)', html )[5:], reverse=True)[0] | |||
hou.hipFile.merge(url+hip) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='python'> | |||
import re | |||
try: | |||
import urlopen | |||
html = urllib.request.urlopen(url).read() | |||
except ImportError: | |||
import urllib2 | |||
html = urllib2.urlopen(url).read() | |||
hip = sorted( re.findall(r'href=[\'"]?([^\'" >]+)', html )[5:], reverse=True)[0] | hip = sorted( re.findall(r'href=[\'"]?([^\'" >]+)', html )[5:], reverse=True)[0] | ||
hou.hipFile.merge(url+hip) | hou.hipFile.merge(url+hip) | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 00:58, 1 October 2021
import re, urlopen url = 'http://hip.johnkunz.com/ttv/' html = urllib.request.urlopen(url).read() hip = sorted( re.findall(r'href=[\'"]?([^\'" >]+)', html )[5:], reverse=True)[0] hou.hipFile.merge(url+hip)
import re, urllib2 url = 'http://hip.johnkunz.com/ttv/' html = urllib2.urlopen(url).read() hip = sorted( re.findall(r'href=[\'"]?([^\'" >]+)', html )[5:], reverse=True)[0] hou.hipFile.merge(url+hip)
import re try: import urlopen html = urllib.request.urlopen(url).read() except ImportError: import urllib2 html = urllib2.urlopen(url).read() hip = sorted( re.findall(r'href=[\'"]?([^\'" >]+)', html )[5:], reverse=True)[0] hou.hipFile.merge(url+hip)