mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 01:33:37 +02:00
Use a custom user agent when downloading plugins
This commit is contained in:
parent
cf2f7ffd7f
commit
1582b14385
1 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,7 @@
|
|||
from PyQt4.QtGui import QLineEdit
|
||||
|
||||
from calibre import browser, prints
|
||||
from calibre.constants import numeric_version, iswindows, isosx, DEBUG
|
||||
from calibre.constants import numeric_version, iswindows, isosx, DEBUG, __appname__, __version__
|
||||
from calibre.customize.ui import (
|
||||
initialized_plugins, is_disabled, remove_plugin, add_plugin, enable_plugin, disable_plugin,
|
||||
NameConflict, has_external_plugins)
|
||||
|
|
@ -836,7 +836,7 @@ def _read_version_history_html(self, forum_link):
|
|||
|
||||
def _download_zip(self, plugin_zip_url):
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
br = browser()
|
||||
br = browser(user_agent='%s %s' % (__appname__, __version__))
|
||||
raw = br.open_novisit(plugin_zip_url).read()
|
||||
with PersistentTemporaryFile('.zip') as pt:
|
||||
pt.write(raw)
|
||||
|
|
|
|||
Loading…
Reference in a new issue