mirror of
https://source.perfectable.org/nivertius/napi.git
synced 2025-07-02 06:55:03 +02:00
purely using urllib
This commit is contained in:
parent
75144c2d11
commit
79b2058747
1 changed files with 3 additions and 5 deletions
8
napi
8
napi
|
@ -14,10 +14,9 @@
|
||||||
# POZDRAWIAMY NASZYCH FANOW!
|
# POZDRAWIAMY NASZYCH FANOW!
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import sys, urllib, os
|
import sys
|
||||||
|
|
||||||
import urllib
|
import urllib
|
||||||
import urllib2
|
import os
|
||||||
|
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
@ -60,8 +59,7 @@ def download_subtitles(movie_digest):
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
request_stream = urllib.urlencode(request_data)
|
request_stream = urllib.urlencode(request_data)
|
||||||
request = urllib2.Request(base_url, request_stream)
|
response = urllib.urlopen(base_url, request_stream)
|
||||||
response = urllib2.urlopen(request)
|
|
||||||
xml = ET.XML(response.read())
|
xml = ET.XML(response.read())
|
||||||
content = xml.find("subtitles").find("content").text
|
content = xml.find("subtitles").find("content").text
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Add table
Reference in a new issue