Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
Custom User-Agent header
Browse files Browse the repository at this point in the history
  • Loading branch information
mineo committed Apr 16, 2016
1 parent b0d84a2 commit 7e3c6de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion abzer/abzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, num_processes, essentia_path, profile_path, filenames):
self.filenames = filenames
self.num_processes = num_processes
self.profile_path = profile_path
self.session = aiohttp.ClientSession()
self.session = aiohttp.ClientSession(headers=const.HEADERS)
# Set the queue size to double the amount of processes. That way, more
# filenames than subprocesses are in the queue, but not all of them
# (which might be hundreds of thousands).
Expand Down
2 changes: 2 additions & 0 deletions abzer/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# coding: utf-8
# Copyright © 2016 Wieland Hoffmann
# License: MIT, see LICENSE for details
from .version import version
from os.path import expanduser, join

HTTP_OK = 200
Expand All @@ -12,4 +13,5 @@
LOGFILE = join(DEFAULT_PATH, "filelog.sqlite")
DEFAULTS = {"path": "/usr/bin/streaming_extractor_music",
"profile": join(DEFAULT_PATH, "profile.yaml")}
HEADERS = {"User-Agent": "abzer %s (https://github.com/mineo/abzer)" % version}
URL_BASE = "http://acousticbrainz.org/%s/low-level"

0 comments on commit 7e3c6de

Please sign in to comment.