Skip to content

Commit 5eeab85

Browse files
committed
v0.5.10
2 parents 6720575 + f640451 commit 5eeab85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3491
-2034
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ install:
1616
- pip install pep8
1717
script:
1818
- pep8 headphones
19-
- pylint --rcfile=pylintrc headphones
2019
- pyflakes headphones
2120
- nosetests headphones

API.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Unmark album as wanted / i.e. mark as skipped
6666

6767
### forceSearch
6868
force search for wanted albums - not launched in a separate thread so it may take a bit to complete
69-
### forceProcess
69+
### forceProcess[&dir=/path/to/folder]
7070
Force post process albums in download directory - also not launched in a separate thread
7171
### forceActiveArtistsUpdate
7272
force Active Artist Update - also not launched in a separate thread
@@ -108,4 +108,4 @@ See above.
108108
Gives you a list of results from searcher.searchforalbum(). Basically runs a normal search, but rather than sorting them and downloading the best result, it dumps the data, which you can then pass on to download_specific_release(). Returns a list of dictionaries with params: title, size, url, provider & kind - all of these values must be passed back to download_specific_release
109109

110110
### download_specific_release&id=albumid&title=$title&size=$size&url=$url&provider=$provider&kind=$kind
111-
Allows you to manually pass a choose_specific_download release back to searcher.send_to_downloader()
111+
Allows you to manually pass a choose_specific_download release back to searcher.send_to_downloader()

CHANGELOG.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## v0.5.10
4+
Released 29 January 2016
5+
6+
Highlights:
7+
* Added: API option to post-process single folders
8+
* Added: Ability to specify extension when re-encoding
9+
* Added: Option to stop renaming folders
10+
* Fixed: Utorrent torrents not being removed (#2385)
11+
* Fixed: Torznab to transmission
12+
* Fixed: Magnet folder names in history
13+
* Fixed: Multiple torcache fixes
14+
* Fixed: Updated requests & urllib3 to latest versions to fix errors with pyOpenSSL
15+
* Improved: Use a temporary folder during post-processing
16+
* Improved: Added verify_ssl_cert option
17+
* Improved: Fixed track matching progress
18+
* Improved: pylint, pep8 & pylint fixes
19+
* Improved: Stop JS links from scrolling to the top of the page
20+
21+
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.9...v0.5.10).
22+
323
## v0.5.9
424
Released 05 September 2015
525

@@ -12,7 +32,7 @@ Highlights:
1232
* Fixed: Pushover notifications
1333
* Improved: Rutracker logging, switched to requests lib
1434

15-
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.6...v0.5.7).
35+
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.8...v0.5.9).
1636

1737
## v0.5.8
1838
Released 13 July 2015
@@ -30,7 +50,7 @@ Highlights:
3050
* Improved: Set localhost as default
3151
* Improved: Better single artist scanning
3252

33-
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.6...v0.5.7).
53+
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.7...v0.5.8).
3454

3555
## v0.5.7
3656
Released 01 July 2015

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
#![Headphones Logo](https://github.com/rembo10/headphones/raw/master/data/images/headphoneslogo.png) Headphones
1+
##![Headphones Logo](https://github.com/rembo10/headphones/raw/master/data/images/headphoneslogo.png) Headphones
2+
3+
**Master Branch:** [![Build Status](https://travis-ci.org/rembo10/headphones.svg?branch=master)](https://travis-ci.org/rembo10/headphones)
4+
**Develop Branch:** [![Build Status](https://travis-ci.org/rembo10/headphones.svg?branch=develop)](https://travis-ci.org/rembo10/headphones)
25

36
Headphones is an automated music downloader for NZB and Torrent, written in Python. It supports SABnzbd, NZBget, Transmission, µTorrent and Blackhole.
47

@@ -18,8 +21,8 @@ You are free to join the Headphones support community on IRC where you can ask q
1821

1922
1. Analyze your log, you just might find the solution yourself!
2023
2. You read the wiki and searched existing issues, but this is not solving your problem.
21-
3. Post the issue with a clear title, description and the HP log and use [proper markdown syntax](https://help.github.com/articles/github-flavored-markdown) to structure your text (code/log in code blocks).
22-
4. Close your issue when it's solved! If you found the solution yourself please comment so that others benefit from it.
24+
3. Post the issue with a clear title, description and the HP log and use [proper markdown syntax](https://help.github.com/articles/github-flavored-markdown) to structure your text (code/log in code blocks).
25+
4. Close your issue when it's solved! If you found the solution yourself, please comment so that others benefit from it.
2326

2427
**Feature requests** can be reported on the GitHub issue tracker too:
2528

contrib/sni_test.py

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
import sys
5+
6+
# Ensure that we use the Headphones provided libraries.
7+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib"))
8+
9+
import urlparse
10+
11+
12+
def can_import(module):
13+
"""
14+
Return True if a given module can be imported or not.
15+
"""
16+
17+
try:
18+
__import__(module)
19+
except ImportError:
20+
return False
21+
22+
# Module can be imported
23+
return True
24+
25+
26+
def check_installation():
27+
"""
28+
Check if some core modules are available. Info is based on this topic:
29+
https://github.com/rembo10/headphones/issues/2210.
30+
"""
31+
32+
if can_import("requests"):
33+
import requests
34+
requests_version = requests.__version__
35+
else:
36+
requests_version = "no"
37+
38+
if can_import("OpenSSL"):
39+
import OpenSSL
40+
openssl_version = OpenSSL.__version__
41+
else:
42+
openssl_version = "no"
43+
44+
if can_import("cryptography"):
45+
import cryptography
46+
cryptography_version = cryptography.__version__
47+
else:
48+
cryptography_version = "no"
49+
50+
if can_import("pyasn1"):
51+
import pyasn1
52+
pyasn1_version = pyasn1.__version__
53+
else:
54+
pyasn1_version = "no"
55+
56+
if can_import("ndg.httpsclient"):
57+
from ndg import httpsclient
58+
ndg_version = httpsclient.__date__
59+
else:
60+
ndg_version = "no"
61+
62+
# Print some system information.
63+
sys.stdout.write(
64+
"* Checking Python version: %s.%s.%s\n" % sys.version_info[:3])
65+
sys.stdout.write("* Operating system: %s\n" % sys.platform)
66+
67+
sys.stdout.write(
68+
"* Checking if requests can be imported: %s\n" % requests_version)
69+
sys.stdout.write(
70+
"* Checking if pyOpenSSL is installed: %s\n" % openssl_version)
71+
sys.stdout.write(
72+
"* Checking if cryptography is installed: %s\n" % cryptography_version)
73+
sys.stdout.write(
74+
"* Checking if pyasn1 is installed: %s\n" % pyasn1_version)
75+
sys.stdout.write(
76+
"* Checking if ndg.httpsclient is installed: %s\n" % ndg_version)
77+
78+
79+
def main():
80+
"""
81+
Test if the current Headphones installation can connect to SNI-enabled
82+
servers.
83+
"""
84+
85+
# Read the URL to test.
86+
if len(sys.argv) == 1:
87+
url = "https://sni.velox.ch/"
88+
else:
89+
url = sys.argv[1]
90+
91+
# Check if it is a HTTPS website.
92+
parts = urlparse.urlparse(url)
93+
94+
if parts.scheme.lower() != "https":
95+
sys.stderr.write(
96+
"Error: provided URL does not start with https://\n")
97+
return 1
98+
99+
# Gather information
100+
check_installation()
101+
102+
# Do the request.
103+
if not can_import("requests"):
104+
sys.stderr.exit("Error: cannot continue without requests module!\n")
105+
return 1
106+
107+
sys.stdout.write("* Performing request: %s\n" % url)
108+
109+
import requests
110+
requests.packages.urllib3.disable_warnings()
111+
112+
try:
113+
try:
114+
response = requests.get(url)
115+
except requests.exceptions.SSLError as e:
116+
sys.stdout.write(
117+
"- Server certificate seems invalid. I will disable "
118+
"certificate check and try again. You'll see the real "
119+
"exception if it fails again.\n")
120+
sys.stdout.write(
121+
"* Retrying request with certificate verification off.\n")
122+
response = requests.get(url)
123+
except Exception as e:
124+
sys.stdout.write(
125+
"- An error occured while performing the request. The "
126+
"exception was: %s\n" % e.message)
127+
sys.stdout.write(
128+
"- Consult the Troubleshooting wiki (https://github.com/"
129+
"rembo10/headphones/wiki/Troubleshooting) before you post an "
130+
"issue!")
131+
return 0
132+
133+
# Verify the response.
134+
if response.status_code == 200:
135+
sys.stdout.write("+ Got a valid response. All seems OK!\n")
136+
else:
137+
sys.stdout.write(
138+
"- Server returned status code %s. Expected a status code 200.\n",
139+
response.status_code)
140+
sys.stdout.write(
141+
"- However, I was able to communicate to the server!\n")
142+
143+
# E.g. `python sni_test.py https://example.org'.
144+
if __name__ == "__main__":
145+
sys.exit(main())

data/interfaces/default/album.html

+11-11
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414

1515
<a id="menu_link_delete" href="deleteAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}"><i class="fa fa-trash-o"></i> Delete Album</a>
1616
%if album['Status'] == 'Skipped' or album['Status'] == 'Ignored':
17-
<a id="menu_link_wanted" href="#" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=False', $(this),true)" data-success="'${album['AlbumTitle']}' added to queue"><i class="fa fa-heart"></i> Mark Album as Wanted</a>
17+
<a id="menu_link_wanted" href="javascript:void(0)" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=False', $(this),true)" data-success="'${album['AlbumTitle']}' added to queue"><i class="fa fa-heart"></i> Mark Album as Wanted</a>
1818
%elif album['Status'] == 'Wanted':
19-
<a id="menu_link_check" href="#" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=True', $(this));" data-success="Forced checking successful"><i class="fa fa-search"></i> Force Check</a>
20-
<a id="menu_link_skipped" href="#" onclick="doAjaxCall('unqueueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}', $(this),true);" data-success="'${album['AlbumTitle']}' marked as Skipped"><i class="fa fa-step-forward"></i> Mark Album as Skipped</a>
19+
<a id="menu_link_check" href="javascript:void(0)" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=True', $(this));" data-success="Forced checking successful"><i class="fa fa-search"></i> Force Check</a>
20+
<a id="menu_link_skipped" href="javascript:void(0)" onclick="doAjaxCall('unqueueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}', $(this),true);" data-success="'${album['AlbumTitle']}' marked as Skipped"><i class="fa fa-step-forward"></i> Mark Album as Skipped</a>
2121
%else:
22-
<a id="menu_link_retry" href="#" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=False', $(this),true);" data-success="Retrying the same version of '${album['AlbumTitle']}'"><i class="fa fa-refresh"></i> Retry Download</a>
23-
<a id="menu_link_new" href="#" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=True', $(this),true);" data-success="Looking for a new version of '${album['AlbumTitle']}'"><i class="fa fa-download"></i> Try New Version</a>
22+
<a id="menu_link_retry" href="javascript:void(0)" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=False', $(this),true);" data-success="Retrying the same version of '${album['AlbumTitle']}'"><i class="fa fa-refresh"></i> Retry Download</a>
23+
<a id="menu_link_new" href="javascript:void(0)" onclick="doAjaxCall('queueAlbum?AlbumID=${album['AlbumID']}&ArtistID=${album['ArtistID']}&new=True', $(this),true);" data-success="Looking for a new version of '${album['AlbumTitle']}'"><i class="fa fa-download"></i> Try New Version</a>
2424
%endif
25-
<a class="menu_link_edit" id="album_chooser" href="#"><i class="fa fa-pencil"></i> Choose Alternate Release</a>
25+
<a class="menu_link_edit" id="album_chooser" href="javascript:void(0)"><i class="fa fa-pencil"></i> Choose Alternate Release</a>
2626
<div id="dialog" title="Choose an Alternate Release" style="display:none" class="configtable">
2727
<div class="links">
2828
<%
2929
alternate_albums = myDB.select("SELECT * from allalbums WHERE AlbumID=? ORDER BY ReleaseDate ASC", [album['AlbumID']])
3030
%>
3131
%if not alternate_albums:
3232
<p>No alternate releases found. Try refreshing the artist (if the artist is being refreshed, please wait until it's finished)</p>
33-
<h2><a id="refresh_artist" onclick="doAjaxCall('refreshArtist?ArtistID=${album['ArtistID']}', $(this)), true" href="#" data-success="'${album['ArtistName']}' is being refreshed">Refresh Artist</a></h2>
33+
<h2><a id="refresh_artist" onclick="doAjaxCall('refreshArtist?ArtistID=${album['ArtistID']}', $(this)), true" href="javascript:void(0)" data-success="'${album['ArtistName']}' is being refreshed">Refresh Artist</a></h2>
3434
%else:
3535
%for alternate_album in alternate_albums:
3636
<%
@@ -43,12 +43,12 @@ <h2><a id="refresh_artist" onclick="doAjaxCall('refreshArtist?ArtistID=${album['
4343
alternate_album_name = alternate_album['AlbumTitle'] + " (" + alternate_album['ReleaseCountry'] + ", " + str(alternate_album['ReleaseDate']) + ", " + alternate_album['ReleaseFormat'] + ") [" + str(have_track_count) + "/" + str(track_count) + " tracks]"
4444

4545
%>
46-
<a href="#" onclick="doAjaxCall('switchAlbum?AlbumID=${album['AlbumID']}&ReleaseID=${alternate_album['ReleaseID']}', $(this), 'table');" data-success="Switched release to: ${alternate_album_name}">${alternate_album_name}</a><a href="${mb_link}" target="_blank">MB</a><br>
46+
<a href="javascript:void(0)" onclick="doAjaxCall('switchAlbum?AlbumID=${album['AlbumID']}&ReleaseID=${alternate_album['ReleaseID']}', $(this), 'table');" data-success="Switched release to: ${alternate_album_name}">${alternate_album_name}</a><a href="${mb_link}" target="_blank">MB</a><br>
4747
%endfor
4848
%endif
4949
</div>
5050
</div>
51-
<a class="menu_link_edit" id="edit_search_term" href="#"><i class="fa fa-pencil"></i> Edit Search Term</a>
51+
<a class="menu_link_edit" id="edit_search_term" href="javascript:void(0)"><i class="fa fa-pencil"></i> Edit Search Term</a>
5252
<div id="dialog2" title="Enter your own search term for this album" style="display:none" class="configtable">
5353
<form action="editSearchTerm" method="GET" id="editSearchTerm">
5454
<input type="hidden" name="AlbumID" value="${album['AlbumID']}">
@@ -64,7 +64,7 @@ <h2><a id="refresh_artist" onclick="doAjaxCall('refreshArtist?ArtistID=${album['
6464
<input type="button" value="Save changes" onclick="doAjaxCall('editSearchTerm',$(this),'tabs',true);return false;" data-success="Search term updated"/>
6565
</form>
6666
</div>
67-
<a class="menu_link_edit" id="choose_specific_download" href="#" onclick="getAvailableDownloads()"><i class="fa fa-search"></i> Choose Specific Download</a>
67+
<a class="menu_link_edit" id="choose_specific_download" href="javascript:void(0)" onclick="getAvailableDownloads()"><i class="fa fa-search"></i> Choose Specific Download</a>
6868
<div id="choose_specific_download_dialog" title="Choose a specific download for this album" style="display:none" class="configtable">
6969
<table class="display" id="downloads_table">
7070
<thead>
@@ -238,7 +238,7 @@ <h2 id="artistname">
238238
feedback.fadeOut();
239239
search_results = data
240240
for( var i = 0, len = data.length; i < len; i++ ) {
241-
$('#downloads_table_body').append('<tr><td id="title"><a href="#" onclick="downloadSpecificRelease('+i+')">'+data[i].title+'</a></td><td id="size"><span title='+data[i].size+'></span>'+(data[i].size / (1024*1024)).toFixed(2)+' MB</td><td id="provider">'+data[i].provider+'</td><td id="kind">'+data[i].kind+'</td><td id="matches">'+data[i].matches+'</td></tr>');
241+
$('#downloads_table_body').append('<tr><td id="title"><a href="javascript:void(0)" onclick="downloadSpecificRelease('+i+')">'+data[i].title+'</a></td><td id="size"><span title='+data[i].size+'></span>'+(data[i].size / (1024*1024)).toFixed(2)+' MB</td><td id="provider">'+data[i].provider+'</td><td id="kind">'+data[i].kind+'</td><td id="matches">'+data[i].matches+'</td></tr>');
242242
}
243243
$('#downloads_table').dataTable({
244244
"aoColumns": [

0 commit comments

Comments
 (0)