Author: johnnyg
Revision: 5875
Log:
Use custom user-agent when downloading files with httpdownloader.
Diff:
Modified: trunk/deluge/httpdownloader.py
===================================================================
--- trunk/deluge/httpdownloader.py 2009-10-26 03:10:29 UTC (rev 5874)
+++ trunk/deluge/httpdownloader.py 2009-10-26 13:58:42 UTC (rev 5875)
@@ -36,6 +36,7 @@
from twisted.web.error import PageRedirect
from twisted.python.failure import Failure
from twisted.internet import reactor
+from common import get_version
class HTTPDownloader(client.HTTPDownloader):
"""
@@ -56,7 +57,8 @@
self.__part_callback = part_callback
self.current_length = 0
self.value = filename
- client.HTTPDownloader.__init__(self, url, filename, headers=headers)
+ agent = "Deluge/%s (http://deluge-torrent.org)" % get_version()
+ client.HTTPDownloader.__init__(self, url, filename, headers=headers,
agent=agent)
def gotStatus(self, version, status, message):
self.code = int(status)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---