Compare commits

..
1637 Commits
Author SHA1 Message Date
AdeHub 62757c0fcf Merge pull request #3367 from confor/fix-deps
Add imghdr and cgi
2025-06-02 08:39:31 +12:00
AdeHub 63c992a4e5 Merge pull request #3363 from hypsometric/deluge_fix
Fix deluge torrent upload
2025-05-31 12:17:20 +12:00
AdeHub 63549b2471 fix weserv blocking 2025-05-31 12:05:49 +12:00
confor 3ff431da4b add cgi (py 3.13+ support)
sourced from youknowone/python-deadlib
2025-05-22 22:04:07 -04:00
confor 8ccc3cb146 add imghdr (py 3.13+ support)
this package was deprecated and removed in python 3.13+.

sourced from youknowone/python-deadlib
2025-05-22 21:56:10 -04:00
hypsometric 6764783aa7 Fix deluge torrent upload
Fix torrent file encoding for deluge
- received content is bytes
- we need to convert this content into base64
- we then need to convert base64 bytes into base64 string to include in
  the json data
binary
Fixes #3362
2025-04-17 12:33:43 +02:00
AdeHub 828fc0ccda Merge pull request #3359 from hypsometric/gazelle_improvements
Gazelle improvements
2025-04-12 15:28:44 +12:00
AdeHub 68a495127e Potential fix for #3355
Potential fix for #3355
2025-04-12 15:26:21 +12:00
Hypsometric 26a6095851 Make Gazelle torrents sorting clearer
Sort by format and most seeders if `search_formats` has data.
Sort only by most seeders else.
2025-03-19 17:20:46 +01:00
Hypsometric 95bd0a57ff Refactor common Orpheus & Redacted code
Orpheus & Redacted being based on Gazelle API, their code was the same
(with the exception of release type filtering).

Merging both will make maintenance easy and brings Redacted on par with
Orpheus regarding release type filtering.
2025-03-19 17:20:46 +01:00
Hypsometric 5efbd561d6 Allow the use of apikey with GazelleAPI & Redacted 2025-03-19 17:16:55 +01:00
AdeHub b690850019 torznab enclosure url 2024-12-07 19:58:57 +13:00
AdeHub a09e91ff8a cherrypy update
fixes #3348
2024-12-07 19:56:21 +13:00
AdeHub 94d62430a0 Ignore bs4 warning 2024-12-07 09:55:00 +13:00
AdeHub 2d5102d29c Remove unused directory 2024-08-24 17:02:22 +12:00
AdeHub 046d4d82b4 update Beets 2024-08-24 16:44:41 +12:00
AdeHub a63098a919 update urllib3 2024-08-24 16:42:31 +12:00
AdeHub 38d8e13e4e update Soupsieve 2024-08-24 16:36:55 +12:00
AdeHub b3edfa0d87 update requests_oauthlib 2024-08-24 16:33:52 +12:00
AdeHub aeebc67365 update requests 2024-08-24 16:25:17 +12:00
AdeHub d6f22a2326 Update Beautiful Soup 2024-08-24 16:18:38 +12:00
AdeHub 5b1d9c0750 update mutagen 2024-08-24 16:00:16 +12:00
AdeHub ba666f68b8 tpb tidy up 2024-08-16 12:44:17 +12:00
AdeHub 000509353a qBitTorrent Seed Ratio fix
- added missing api param
2024-08-11 07:53:58 +12:00
AdeHub c264c75282 Removed Waffles
😧
2024-08-10 11:34:30 +12:00
AdeHub 4c15b33c58 TPB fixes
- changed default to use apibay.org

- removed 'Old Pirate Bay'
2024-08-10 11:20:23 +12:00
AdeHub 167b5817e7 forcePostProcess more encoding
- encode all download dirs so subsequent decode will work
2024-07-23 21:11:05 +12:00
AdeHub 46c7582fb1 Merge pull request #3342 from dsm1212/issue3341
decode paths before using them to fix manual post process
2024-07-23 20:17:10 +12:00
dsm1212 7b9e32f525 fix duplicate file rename 2024-07-14 20:55:05 -04:00
AdeHub 37c4e19663 Torznab changes
-Search using parent category 3000

some providers lump everything in to the parent Music Category 3000 instead of the Sub Category (e.g. 3040 lossless).

search using 3000 then filter with Category (if returned) or Headphones filtering

overall this should return more results across indexers

-Allow Prowlarr indexers to be manually entered

-Searcher fixups
2024-07-08 21:18:19 -04:00
AdeHub e5beb5291d Soulseek tweaks # 2
push results through filters
2024-07-08 21:18:19 -04:00
AdeHub ebe8a60ca5 Soulseek tweaks
-include soulseek results in overall search results

-fixed windows paths not quite working on macOS

-allow user search term

-tighten search for self titled, Various Artists

-postprocess by user/folder

-bit more logging
2024-07-08 21:18:19 -04:00
AdeHub 040de81d3c Torznab changes
-Search using parent category 3000

some providers lump everything in to the parent Music Category 3000 instead of the Sub Category (e.g. 3040 lossless).

search using 3000 then filter with Category (if returned) or Headphones filtering

overall this should return more results across indexers

-Allow Prowlarr indexers to be manually entered

-Searcher fixups
2024-07-05 19:26:30 +12:00
Steve McAfee 1bf8c35154 decode paths before using them to fix manual post process 2024-07-03 21:22:55 -04:00
AdeHub dae4d80490 Soulseek tweaks # 2
push results through filters
2024-06-19 20:33:40 +12:00
AdeHub acf73368c9 Soulseek tweaks
-include soulseek results in overall search results

-fixed windows paths not quite working on macOS

-allow user search term

-tighten search for self titled, Various Artists

-postprocess by user/folder

-bit more logging
2024-06-16 20:01:35 +12:00
rembo10 abac9b5a15 Merge branch 'develop' 2024-05-26 21:12:22 +05:30
rembo10 ace2b4f26a Update changelog for v0.6.3 2024-05-26 21:12:09 +05:30
rembo10 ebba115443 Fix for searcher not returning results 2024-05-26 19:58:45 +05:30
rembo10 b54218abbd Merge branch 'develop' 2024-05-26 09:52:28 +05:30
rembo10 3e354ff128 Update changelog for v0.6.2 2024-05-26 09:52:17 +05:30
rembo10 b8168ec8eb add slskd_api @ v0.1.5 2024-05-26 09:47:43 +05:30
rembo10 c0c636d545 Merge remote-tracking branch 'el133/slskd-python-api_support' into develop 2024-05-26 09:44:54 +05:30
rembo10 33d1d17c97 Merge remote-tracking branch 'nopoz/deluge' into develop 2024-05-26 09:42:23 +05:30
rembo10 8fd13621f5 Fix some invalid escape sequences in helpers.py 2024-05-26 09:37:05 +05:30
rembo10 56674adfea Merge branch 'python312' into develop 2024-05-26 09:31:16 +05:30
Elmer 489c6cbe71 Basic soulseek support 2024-02-28 12:53:55 +01:00
AdeHub 6afe31bffc bandcamp tweaks 2024-01-26 21:11:29 +13:00
rembo10 742529a92d munkres: 1.0.6 -> 1.1.4 2024-01-18 16:12:15 +05:30
rembo10 944d066903 Fix regex warnings in postprocessor.py 2024-01-18 16:10:33 +05:30
rembo10 87819a3c74 Remove redundant bencode import from searcher.py 2024-01-18 16:09:22 +05:30
rembo10 c9fbe29c90 Fix regex warnings in deluge.py 2024-01-18 16:06:51 +05:30
rembo10 d78cb7d14e Import mediafile from bandcamp.py 2024-01-18 16:04:42 +05:30
rembo10 e8c392824f Fix regex warnings in pygazelle 2024-01-18 16:02:59 +05:30
rembo10 9811df2779 Slightly clean up searcher.py, fix regex warnings 2024-01-18 16:01:26 +05:30
rembo10 1a4865ed38 Remove unused functions (nameQuality, statusFromName) from common.py 2024-01-18 15:17:37 +05:30
rembo10 a06fb40f50 tzlocal: 1.1.2 -> 5.2 2024-01-18 14:59:28 +05:30
rembo10 ad6a4f570e use pkg_resources from setuptools-69.0.3 2024-01-18 14:56:54 +05:30
rembo10 3685d32a7d cherrypy: 18.8.0 -> 6387a2b 2024-01-18 14:55:28 +05:30
rembo10 152f5daa8c Sync up master and develop branches 2023-11-27 13:40:34 +05:30
Mikaël Hautinandrembo10 39054a04df Update parsing logic for updated TPB proxy html structure (#3318)
* fix: Update parsing logic for updated TPB proxy html structure

---------

Co-authored-by: rembo10 <rembo10@users.noreply.github.com>
2023-11-27 10:04:10 +05:30
kirill9617 1c4b9c10f0 Fix for 503 error from CloudFlare. (#3316)
CloudFlare seems to block request without User-Agent header. This fix should be enough to bypass that.
2023-11-26 15:15:36 +05:30
Menno Blom 73ca787cf1 Bandcamp support (#3252)
* Add configuration options for bandcamp

* Add bandcamp config options

* Add bandcamp config options

* Initial crude bandcamp search and download support

* Add bandcamp search support

* Better utf-8 handling and tagging of the downloads

* Post-process bandcamp dodwnload directory

* Tweak the order of downloads (prevent querying bandcamp too often)

* Show [bandcamp] link in the history page

* pep8

* Use more sane loglevels

* Oops.

* Patch regexp to support new bandcamp page structure

* Make sure the file-key exists, is not None and contains data
2023-11-26 15:13:13 +05:30
rembo10 c7bc852868 Update changelog for v0.6.1 2023-11-26 14:30:29 +05:30
rembo10 391b0cc465 Merge branch 'develop' 2023-11-26 14:27:56 +05:30
rembo10 4aaeaa704f apscheduler: 3.0.1 -> 3.10.1 2023-06-09 07:26:41 +05:30
rembo10 4d14b028ff update cherrypy to v18.8.0 2023-04-20 15:06:17 +05:30
rembo10 a78f38c174 Update changelog for v0.6.0 2022-11-13 09:39:20 +05:30
rembo10 14f2a6d22c Merge branch 'develop' 2022-11-13 09:34:39 +05:30
rembo10 2e4299efa7 Merge branch 'lastfm-api-key' into develop 2022-11-13 09:31:24 +05:30
rembo10 0610c2fa93 Fix formatting of Last.fm in log messages 2022-11-12 16:45:43 +05:30
rembo10 9add571886 Re-enable Last.fm similar tag cloud 2022-11-12 16:44:01 +05:30
rembo10 fcf59a9b38 add an option for a personal last.fm api key 2022-11-12 15:48:31 +05:30
AdeHub 74f9e91afc Various
xld - use native plistlib instead of biplist

rutracker - use new Result object

seacher - small tweaks

transmission - str no longer required
2022-03-05 19:08:12 +13:00
rembo10 83398cb102 metadata: Fix typo in DISC_TOTAL 2022-02-18 15:04:42 +05:30
rembo10 61c2e1f821 Add option to ignore disc# for single disc albums (#3297) 2022-02-18 11:59:15 +05:30
rembo10 3e3047aef2 Use str(e) instead of e.message in searcher.py 2022-02-15 15:11:27 +05:30
rembo10 fff44e4631 Various fixes from last commit, fixes an issue where the hash couldn't be calculated from the torrent data 2022-02-15 15:06:26 +05:30
rembo10 0964371de8 Require python 3.7+ for dataclasses 2022-02-15 14:28:44 +05:30
rembo10 654f923a8d A little cleanup in searcher.py 2022-02-15 14:14:06 +05:30
rembo10 b91206c64a Remove tests from libs 2022-02-14 13:43:44 +05:30
rembo10 c9ba59ee9a Add zipp lib 2022-02-14 13:42:40 +05:30
rembo10 b7e35d5ff0 Decode the b64 data to utf-8 for nzbget (#3294) 2022-02-14 10:14:44 +05:30
rembo10 9d82143abe Remove errant print statements 2022-02-14 08:51:39 +05:30
rembo10 eaf2db6c59 Open blackhole nzb file as binary 2022-02-14 08:12:47 +05:30
rembo10 586b9ed3c8 Add importlib_resources to lib 2022-02-14 07:45:09 +05:30
rembo10 d89f4171da Disable interpolation in ConfigParser 2022-02-13 10:13:47 +05:30
rembo10 9f7be5348b Prevent accessing error.message in db.py action 2022-02-11 10:42:11 +05:30
rembo10 9c254ff222 Fix for trying to access e.message in findArtist 2022-02-11 10:34:44 +05:30
rembo10 ba969fd3b8 Fix for sending invalid dates to helpers.age 2022-02-10 07:37:49 +05:30
rembo10 c851d5ed1a Remove ordereddict 2022-02-09 21:24:20 +05:30
rembo10 2223928958 Fix sort by have in web ui, a little import cleanup in webserve.py 2022-02-09 21:10:14 +05:30
rembo10 164c3cacbc Disable last.fm getSimilar in importer 2022-02-09 17:51:12 +05:30
rembo10 16d4ac8895 Fixed some imports in helpers.py 2022-02-09 02:48:50 +05:30
rembo10 f4d60226b3 Disable last.fm getSimilar 2022-02-08 19:37:33 +05:30
rembo10 9ca87e23b2 A less insane library scan interval 2022-02-08 19:27:44 +05:30
rembo10 d934c865c6 Fix for adding albums with no release date 2022-02-08 18:41:24 +05:30
rembo10 de74cd2502 Fix typo in librarysync: track['Location'] 2022-02-08 16:24:11 +05:30
rembo10 f41db714a9 Remove any quotes from str/path values in the config 2022-02-08 16:14:06 +05:30
rembo10 f03b82e5f6 Update mutagen to 1.45.1 2022-02-07 09:30:17 +05:30
rembo10 e2db680b9e Catch NoneType in helpers.py/multikeysort 2022-02-07 08:07:18 +05:30
rembo10 a3db89c11d Update minimum version 2022-02-04 07:42:57 +05:30
rembo10 517d0eb327 Merge branch 'develop' 2022-02-01 20:11:24 +05:30
rembo10 2bacd5a0fc Merge branch 'https' into develop 2022-01-23 14:23:42 +05:30
rembo10 5a559c526d http -> https for album art with small refactor 2022-01-23 14:23:27 +05:30
rembo10 095cee9368 http -> https for internet calls 2022-01-23 14:08:36 +05:30
rembo10 79cb133d1d Remove non-ascii chars in nzb folder name 2022-01-22 08:34:47 +05:30
rembo10 3a9b749017 Merge branch 'develop' 2022-01-22 08:11:01 +05:30
rembo10 0182be2f27 Merge pull request #3284 from hypsometric/py3
Fixes for Python 3.10
2022-01-22 08:01:58 +05:30
hypsometric b6388f7daa Fixes for Python 3.10
- deluge: b64encode returns bytes, transform into string before
  serializing to JSON.
- deluge: no more need to try different encodings for the torrent
  filename or the base64-encoded content, should all be unicode strings
  with Python 3
- collections.abc: Iterable, Mapping, MutableMapping, MutableSequence
  moved from collections to collections.abc since Python 3.3
- pygazelle: html.parser.HTMLParser().unescape() moved to
  html.unescape() in Python 3.4
2022-01-19 18:21:16 +01:00
rembo10 0b3d0242fc headphones/__init__.py: file() -> open() 2022-01-15 21:47:45 +05:30
rembo10 9551e1b04a Update pytz lib 2022-01-15 21:46:34 +05:30
rembo10 ab4dd18be4 Initial python3 changes
Mostly just updating libraries, removing string encoding/decoding,
fixing some edge cases. No new functionality was added in this
commit.
2022-01-14 10:38:06 +05:30
rembo10 b3199605be v0.5.20 2021-10-15 09:56:59 +05:30
rembo10 9a7006ad14 Update changelog for v0.5.20 release 2021-10-15 09:56:49 +05:30
rembo10 38197a5871 Merge branch 'ssl-fix' into develop 2021-10-15 08:14:19 +05:30
rembo10 ee58f62b2b Update root certificates for the requests lib 2021-10-15 08:13:49 +05:30
AdeHub 58edc604b3 Merge branch 'develop' 2021-07-08 19:57:08 +12:00
AdeHub ba33a5e655 last.fm api key 2021-07-08 19:52:46 +12:00
AdeHub 379fd3d0b8 Merge branch 'develop' 2020-10-17 11:06:38 +13:00
AdeHub 374b106522 last.fm api
last.fm api
2020-10-17 11:02:00 +13:00
AdeHub bf74f57535 Merge branch 'develop' 2020-05-28 10:49:51 +12:00
AdeHub f1a03e5fb6 pep 2020-04-15 07:22:31 +12:00
AdeHub 50cbe2e943 qBit logging 2020-04-15 07:10:51 +12:00
AdeHub 219f855dfc qBittorrent v2 api 2020-04-13 09:50:40 +12:00
AdeHub f18334d87c Merge branch 'develop' 2020-03-07 10:30:57 +13:00
AdeHub 72fce3cdeb last.fm api key
new key
2020-03-07 10:25:45 +13:00
AdeHub 5283b48736 Merge branch 'develop' 2019-09-08 17:38:17 +12:00
AdeHub 507d8aa7d2 Telegram 2019-09-08 17:27:51 +12:00
AdeHub 4bce833c1e pep 2019-08-17 11:48:50 +12:00
AdeHub f7a23bb4d0 Fix/Enhance Telegram 2019-08-17 11:36:55 +12:00
AdeHub 5d145b6f8a revert to older requests version 2019-07-15 13:54:34 +12:00
AdeHub 3ab31f1da7 urllib3
requests supported version
2019-07-14 21:02:40 +12:00
AdeHub cf85d94a37 requests packages 2019-07-14 20:46:19 +12:00
AdeHub a8a53353ee pep 2019-07-14 20:13:00 +12:00
AdeHub 476ee7b312 mb artist relationships
Get Artist Relationship urls including Discogs, Wikepedia etc.

Currently not used
2019-07-14 19:59:48 +12:00
AdeHub 14bef1e63d Use fanart.tv for artist image
last.fm no longer allows access to artist images. Get artist image from fanart.tv  instead
2019-07-14 19:57:40 +12:00
doucheymcdoucherson 138d01db4a deluge udpate 2019-06-15 00:03:03 -07:00
Ade dc22bb006d Hotfix index creation from develop
Fixes #3175
2019-01-08 21:09:41 +13:00
Ade b49cd8a813 Attempt to fix Index creation error 2019-01-06 16:52:39 +13:00
Ade d7275e5a99 Update Requests lib 2019-01-06 12:12:32 +13:00
Ade aa1867cf06 More Jackett redirect stuff 2019-01-01 12:45:59 +13:00
Ade 19b766a7ce Jackett redirect update
Moved the redirect for Transmission, Deluge
2018-12-31 10:22:37 +13:00
Ade b45f3565da Orpheus.network issues 2018-12-21 18:51:48 +13:00
Ade 22525668fd Remove Mininova 2018-12-21 18:21:33 +13:00
Ade af79bc47e8 Escape sql artist string 2018-12-19 20:25:49 +13:00
AdeHub 6208fe0e69 Merge pull request #3165 from hypsometric/gazelle_freeleech_tokens
Redacted: use a FL token when available
2018-12-14 08:38:25 +13:00
Hypsometric f66a37abbd Redacted: use a FL token when available
- Use a FL token when available
- Added a configuration (default off) to enable the feature
- Skip prefetching the data with Deluge as with Transmission in
`preprocess()`

- Note: because QBittorrent & uTorrent need the data to compute the
torrenthash but still require the url to download the file, it will
result in 2 FL tokens used instead of one because the .torrent will be
downloaded twice from the server.

Fixes #3163
2018-12-13 16:41:22 +01:00
AdeHub 4b52ae445d Merge pull request #3160 from doucheymcdoucherson/develop1
Replace apollo.rip with orpheus.network
2018-12-08 17:52:11 +13:00
doucheymcdoucherson 8a2c3169e2 fix whitespace on blank line 2018-11-08 12:12:03 -08:00
doucheymcdoucherson 805eb7dd13 tabs to spaces 2018-11-08 12:08:41 -08:00
doucheymcdoucherson 81486d2cd2 fix for seeder sort with Orpheus 2018-11-08 11:41:33 -08:00
doucheymcdoucherson d1237b052a replace apollo.rip with orpheus.network 2018-11-08 09:58:09 -08:00
AdeHub a4ef757d12 Merge pull request #3144 from cheese1/develop
fix typo
2018-10-14 17:15:03 +13:00
AdeHub bb8eb19dbf Merge pull request #3151 from permster/develop
Workaround for issue #2674
2018-10-14 17:14:33 +13:00
Ade 602e115a29 Disable torznab tests 2018-10-14 15:28:39 +13:00
Ade e2c335db2d more pep 2018-10-13 18:22:54 +13:00
Ade 44583d42dd pep 2018-10-13 18:18:01 +13:00
Ade 43d465ca22 OSX notify import fix 2018-10-13 18:13:53 +13:00
Ade bd60935493 Torrent folder fix 2018-10-13 12:17:58 +13:00
Travis Golliher 0264b1fb0d Workaround for issue #2674 2018-10-06 02:46:13 -07:00
Ade 24f22834ff Torznab/Jackett Seed Ratio 2018-09-07 18:41:47 +12:00
cheese1 aed2e63984 fix missing space 2018-09-03 11:31:39 +02:00
cheese1 694c17a40b fix typo 2018-09-02 20:38:54 +02:00
Ade 6c34bc46e9 Fix Ignore Undated MB Releases not saving 2018-08-25 17:39:30 +12:00
Ade 0b2600b783 Fix helpers.replace_all
- Renamed post processing replace_all to pattern_substitute
- Resurrected replace_all
2018-08-17 18:43:43 +12:00
Ade 693e5b1624 Improve database locking issues
- Added new indexes
- Retry if locked
- Fix upsert race condition
- Various changes to track matching
2018-08-15 14:51:27 +12:00
Ade 287278c049 Merge branch 'develop' of https://github.com/rembo10/headphones into develop 2018-08-14 20:08:59 +12:00
AdeHub 496560909f Merge pull request #3128 from doucheymcdoucherson/develop1
fixes #3110
2018-08-14 20:05:39 +12:00
AdeHub 22b1bf36ab Merge pull request #3124 from doucheymcdoucherson/develop
sort Apollo.rip results by number of seeders
2018-08-14 20:04:40 +12:00
Ade b506a1797d Merge branch 'master' of https://github.com/rembo10/headphones into develop 2018-07-12 12:51:20 +12:00
Ade ff8417b410 Merge branch 'master' into develop 2018-07-12 12:45:19 +12:00
doucheymcdoucherson 741cb466ef fixes #3110 2018-07-06 14:09:12 -07:00
doucheymcdoucherson a99a6abde2 sort Apollo.rip results by number of seeders 2018-07-03 11:46:51 -07:00
Ade 4631b3cbbf Plex update fix 2018-06-14 10:53:24 +12:00
Ade 7230428a31 Speed up albumPage 2018-06-10 10:37:59 +12:00
Ade 2b5b2bd506 rutracker hires
get more lossless results
2018-06-06 18:56:18 +12:00
Ade 99c3e8498d More Jackett magnet 2018-06-03 15:22:16 +12:00
Ade 472f657c88 Jackett magnet links 2018-05-28 20:58:27 +12:00
Ade 368e30067b Remove t411, kick ass 2018-05-10 10:33:52 +12:00
Ade 053fd40e76 pep 2018-04-25 21:03:16 +12:00
Ade 7af7f6be1e Remove Kick Ass 2018-04-25 12:05:21 +12:00
Ade 5fd20e50fd Remove Strike Search 2018-04-25 11:55:14 +12:00
Ade 43df2956fb Remove t411 pt2 2018-04-25 11:48:54 +12:00
Ade 0c96997005 Remove t411 2018-04-25 11:33:39 +12:00
Ade 81651b119a Stop Metacritic 404
Fixes #2715
2018-04-24 20:14:11 +12:00
Ade ecad4d39eb Get Original Folder from Temp directory
Fixes #3109
2018-04-21 11:02:21 +12:00
Ade 0d3be4866f Email date
Fixes #2703
2018-04-14 13:59:18 +12:00
AdeHub eeed89811b Merge pull request #3104 from mirwan/torznab_size_fix
Items from torznab are not returned when size is defined as torznab:attr
2018-04-09 19:58:17 +12:00
Erwan Miran d9bff5dffe size may be set as torznab:attr 2018-04-08 23:43:42 +02:00
rembo10 3b48f22bd9 v0.5.19 2018-03-27 10:14:08 -05:00
rembo10 79d508fb07 Merge branch 'develop' 2018-03-27 10:13:51 -05:00
rembo10 ae8fadd587 Updated changelog for release 2018-03-27 10:13:16 -05:00
Ade 5d7fdc7a82 Speed up Choose Alternate Release
Possible fix for #3078
2018-03-06 16:48:19 +13:00
AdeHub 1ded166765 Merge pull request #3082 from YipYup/master
Add Feature: Ignore Releases Missing a Release Date
2018-03-03 22:07:57 +01:00
Ade 22eb21a4ef Jackett seeders
Use Soup to get seeders returned from Jackett

Fixes #3081
2018-03-03 20:02:14 +13:00
Get your own 'tots. Geez! 4283b381b6 Fix indentation. 2018-02-22 19:17:23 -07:00
Get your own 'tots. Geez! 2cdc6669da Merge branch 'develop' into master 2018-02-22 19:02:29 -07:00
Ade e3983d615d Merge branches 'develop' and 'master' of https://github.com/rembo10/headphones 2017-10-22 09:51:39 +13:00
AdeHub de8fac347d Merge pull request #3037 from Lartza/fix-win-encoding
Fix SYS_ENCODING selection on Windows
2017-10-22 09:49:48 +13:00
Ade da9287d7cf Merge branch 'develop' 2017-10-22 09:45:15 +13:00
Ade f9d73da31b Remove unidecode for windows file names 2017-10-22 09:43:55 +13:00
Lartza 3cc280666e Fix encoding selection on Windows 2017-10-18 22:44:37 +03:00
Ade 0828643c09 Replace windows file/folder problem characters 2017-09-26 11:06:34 +13:00
AdeHub 9b3d7f3bbb Merge pull request #3023 from noam09/develop
Deluge encoding issues with unicode torrent names
2017-09-22 08:54:58 +12:00
Noam 68c551c828 Try DEcoding torrent name utf-8 in params 2017-09-17 02:40:09 +03:00
Noam b7af246340 Try encoding torrent name utf-8 in params 2017-09-17 02:10:30 +03:00
Noam 4c3b60be68 UnicodeDecodeError printing torrent name containing unicode 2017-09-17 01:40:04 +03:00
AdeHub 539db608e2 Merge pull request #3018 from noam09/develop
Added UTF-8 header for encoding issues
2017-09-14 20:01:28 +12:00
Noam 0b6f263985 Added UTF-8 header for encoding issues 2017-09-11 19:38:01 +03:00
AdeHub a10ec8dce4 Merge pull request #3016 from noam09/develop
Deluge WebUI daemons - fix #3010
2017-09-10 12:08:22 +12:00
Noam 867f75a681 Check _if_ WebUI daemons exist before checking _how many_ exist, fix #3010 2017-09-10 02:15:36 +03:00
Ade c8057676db pep 2017-09-07 22:48:54 +12:00
Ade 9197f27a50 Jackett provider formatting 2017-09-07 22:26:30 +12:00
Ade e7062a6710 Jackett/Torznab v2 api
Fixes #2999
2017-09-02 19:14:37 +12:00
Ade 9c2bfcf7d8 Scan Artist exception handling 2017-08-28 20:54:19 +12:00
Ade 4d575787cd last.fm import fix
Fixes #2753
2017-08-24 20:48:15 +12:00
Ade bdf55f8662 replace torcache 2017-08-19 08:42:04 +12:00
Ade cd57668b92 allow .aif 2017-08-15 17:25:37 +12:00
Ade f20520541d Merge branch 'develop' 2017-08-09 12:52:43 +12:00
Ade 48dd832d4e pep 2017-08-09 12:52:11 +12:00
Ade af10088dc8 Merge branch 'develop' 2017-08-09 12:20:53 +12:00
AdeHub cf9737e804 Merge pull request #2958 from Fish2/master
lossless compression of images saved 93KB
2017-07-28 19:05:56 +12:00
AdeHub 4f118eaaef Merge pull request #2957 from permster/develop
Join notification support
2017-07-27 20:41:30 +12:00
AdeHub 79277ddc33 Merge pull request #2969 from doucheymcdoucherson/develop
Make apollo.rip searches specific to the album type
2017-07-27 20:38:27 +12:00
AdeHub 3ee2598f4c Merge pull request #2989 from djl/sort-wanted
Sorted wanted albums by release date.
2017-07-27 20:07:32 +12:00
AdeHub 1e1b8a9351 Merge pull request #2992 from djl/fix-typeerror
Fix TypeError in dbcheck()
2017-07-27 20:06:38 +12:00
David Logie 0cc2dd7b31 Fix TypeError in dbcheck().
Fixes #2987
2017-07-26 12:17:31 +01:00
David Logie 80fe81e345 Sorted wanted albums by release date.
Without this SQLite will order the results by whichever column happens
to be the fastest for it. This will usually result in the rows being
sorted by the primary key (or rowid).

Sorting by release date also matches the sort order of the "upcoming"
albums list.
2017-07-24 12:54:42 +01:00
Ade 0c98085018 Merge branch 'develop' 2017-07-03 11:44:45 +12:00
Ade e96a6fc7c8 Transmission magnet issue
Fixes #2972
2017-06-24 09:27:51 +12:00
Ade ee7254ddbe Version check logging 2017-06-24 09:12:17 +12:00
Ade 3e44baaded Boxcar icon url 2017-06-17 21:36:17 +12:00
doucheymcdoucherson 914ab65577 Make apollo.rip searches specific to the album type 2017-06-16 22:52:47 -07:00
Ade 4d674689b1 rutracker search term fix 2017-06-16 13:02:13 +12:00
Fish2 ae328a15aa lossless compression of images saved 93KB 2017-06-04 11:41:07 +01:00
Travis Golliher c612a228b6 Fix pep8 error 2017-05-31 21:59:48 -07:00
Travis Golliher 334493d81e Join notification support
Fix pep8 errors.
2017-05-31 21:40:01 -07:00
Travis Golliher 50de38ce82 Join notification support
Initial Join by Joaoapps API Notification Support.  See issue #2712.
2017-05-31 21:04:30 -07:00
AdeHub 36434b57ee Merge pull request #2952 from noam09/develop
rutracker optional session cookie
2017-05-27 18:49:45 +12:00
Noam 3110659633 travis space 2017-05-18 18:28:01 +03:00
Noam ecadf8cdab log cookie attempt 2017-05-18 18:26:16 +03:00
Noam 6c0b451882 rutracker optional session cookie 2017-05-18 17:02:53 +03:00
AdeHub 755944f15c Merge pull request #2938 from Kallys/develop
Remove Deezloader integration
2017-05-03 17:34:14 +12:00
Kallys 0acb5a413a Revert "Integration of deezloader provider by ParadoxalManiak under CC BY-NC-SA 4.0"
This reverts commit 04e8767ea9.
2017-05-02 13:41:51 +02:00
Kallys e3c7790039 Revert "Fix #2930"
This reverts commit cd2860f4e3.
2017-05-02 13:41:29 +02:00
AdeHub d802948a35 Merge pull request #2934 from pratstercs/develop
Bug (#2933) - Can't remove artist with name "null"
2017-05-02 18:38:17 +12:00
AdeHub b2f5919b26 Merge pull request #2932 from Kallys/master
Aria2 & deezloader bugfixes
2017-05-02 18:37:26 +12:00
pratstercs 74d5333bdf Fixing tabs/spaces 2017-05-01 00:35:28 +01:00
pratstercs 54edacdfe7 Fixed bug (#2933 at least) where an artist will null name errors when trying to remove from library as logger is trying to concat artist name (NoneType) with string 2017-05-01 00:29:39 +01:00
Kallys cd2860f4e3 Fix #2930
Fix #2931
2017-04-30 14:00:10 +02:00
Ade bc0ce99adf Set clean name to lower 2017-04-29 18:05:10 +12:00
AdeHub 3bfdc9f069 Merge pull request #2925 from Kallys/master
Add deezloader provider and aria2 downloader (part 2)
2017-04-25 21:01:15 +12:00
Ade 39e589bc08 Use Release Id for beets matching if supplied 2017-04-25 18:16:33 +12:00
Ade cef1563b4b Trap errors for Scan 2017-04-25 17:03:59 +12:00
Kallys 04e8767ea9 Integration of deezloader provider by ParadoxalManiak under CC BY-NC-SA 4.0
Integration of aria2 downloader by Xyne under GPLv2

I'm not responsible of any kind for the usage of this programs by other people.
These integrations come with no warranty.
Please refer to your local country laws and respect Deezer's terms of service.
2017-04-24 14:32:51 +02:00
Ade 2df13ad823 bit more beets logging 2017-04-24 14:16:08 +12:00
Ade 18d85d12dd pep 2017-04-23 20:26:04 +12:00
Ade 1e3cbb64ca beets recommendation logging 2017-04-23 20:08:28 +12:00
Ade d6e1a16286 Pass full mb unicode names to beets
Possibly fixes https://github.com/rembo10/headphones/issues/2919
2017-04-22 11:54:18 +12:00
AdeHub 979b06ae55 Merge pull request #2920 from rembo10/revert-2918-master
Revert "Add deezloader provider and aria2 downloader"
2017-04-21 19:46:23 +12:00
AdeHub 7fec54289b Revert "Add deezloader provider and aria2 downloader" 2017-04-21 19:45:37 +12:00
AdeHub 49d632a156 Merge pull request #2918 from Kallys/master
Add deezloader provider and aria2 downloader
2017-04-21 19:35:26 +12:00
Kallys a2a14e185a Merge remote-tracking branch 'upstream/develop' 2017-04-20 14:32:27 +02:00
Ade 50851a4953 pep8 2017-04-20 20:42:04 +12:00
Ade 61a3abbf20 last.fm series info 2017-04-20 20:10:34 +12:00
Kallys e8f436a5db Fix travis errors bis 2017-04-19 20:01:45 +02:00
Kallys 34b8a11145 Fix travis errors 2017-04-19 19:55:41 +02:00
Kallys f0fe23899a Add deezloader provider
Add aria2 downloader
2017-04-19 18:59:27 +02:00
Ade 4eabc1c614 opus format
fixes https://github.com/rembo10/headphones/issues/2909
2017-04-14 08:47:09 +12:00
Ade b9d41ad779 Merge branch 'master' into develop 2017-04-14 08:40:15 +12:00
Ade 8e1cd3155f redacted config fix
Fixes https://github.com/rembo10/headphones/issues/2910
2017-04-14 08:40:04 +12:00
Ade 624a3d6cc1 Merge branch 'master' into develop 2017-04-14 08:39:06 +12:00
Ade a042fd44a2 Merge branch 'develop' 2017-04-14 08:24:10 +12:00
Ade 2e5ce520eb pp fix up
Fixes https://github.com/rembo10/headphones/issues/2911
2017-04-14 08:23:11 +12:00
Ade e9407f5dbc Merge branch 'develop' 2017-04-08 12:01:20 +12:00
Ade 8eb79701a6 t411, pb url change 2017-04-08 11:58:14 +12:00
Ade 4c95f99d80 Transmission pp folder name
Get folder name from hash
2017-04-08 11:51:40 +12:00
Ade e1e361a46e Merge branch 'develop' 2017-04-06 10:11:01 +12:00
Ade 437d33e7a8 Qbittorrent folder name 2017-04-05 21:38:59 +12:00
Ade 2832166842 pep 2017-04-04 22:34:46 +12:00
Ade 2841f36d8d artwork fix
fixes #2898
2017-04-04 22:28:26 +12:00
Ade de15f6b632 Qbittorrent
- Postprocessing get folder from hash
- Postprocessing allow for single file
- Rutracker fix up
2017-04-04 20:24:26 +12:00
AdeHub 5bb6ec04a9 Merge pull request #2892 from DJ-666/develop
Rename PTH to Redacted and fix invalid User-Agent (Again)
2017-04-01 16:22:11 +13:00
DJ-666 1da1f5124a Rename PTH to Redacted and fix invalid User-Agent (Again)
This is a duplicate of albshin's PR as I got impatient waiting for him
to submit it to the develop branch with the addition of removing the
previous user agents and replacing them with Headphones as the agent.
Redacted considers falsifying the agent as a bannable offence.

From albshin's PR;
"Changes all instances of PassTheHeadphones to Redacted. Removed the URL
option for Redacted as it's unnecessary(?).

Fixed a bug in the pyGazelle library in which the User-Agent was invalid
due to a missing space. Should work now for Redacted."
2017-03-31 23:36:34 +10:30
Ade f8b82337a2 error msg tidy up 2017-03-27 12:51:47 +13:00
AdeHub 3efd3931f5 Merge pull request #2887 from noam09/develop
Fix title markdown
2017-03-27 09:35:29 +13:00
Noam 95402144d1 Merge branch 'develop' of github.com:noam09/headphones into develop 2017-03-26 12:36:20 +03:00
Noam 220a8931d1 Fix title markdown
Missing space after ##
2017-03-26 12:34:00 +03:00
Ade a96b186825 Add deluge, qbittorrent to scheduled torrent removal 2017-03-26 11:36:38 +13:00
Ade de3b73dfa5 Move to 2.7 2017-03-25 23:17:41 +13:00
Ade 263564f15f pep8 2017-03-25 23:05:37 +13:00
Ade a5ca14e6d6 Waffles is back!
Ignore 0 seeders for now

Fixes https://github.com/rembo10/headphones/issues/2884
2017-03-25 14:38:23 +13:00
Ade 861747c235 qbittorrent folder name
Fixes #2869
2017-03-25 13:22:24 +13:00
Ade 4095bf213e mutagen, musicbrainzngs, beets lib updates 2017-03-25 11:47:04 +13:00
Ade f3020207c0 Artwork pp
Post processing Min/Max artwork size
2017-03-20 10:18:09 +13:00
Ade 1cee19be74 Merge branch 'develop' of https://github.com/rembo10/headphones into develop 2017-03-16 07:55:47 +13:00
Ade f877caff06 Latest artwork changes not working so well
Revisit later
2017-03-16 07:55:27 +13:00
AdeHub 9c0297326e Merge pull request #2875 from noam09/develop
More exception handling for Deluge torrent removal
2017-03-15 07:14:27 +13:00
Noam 1ed12770c2 Merge branch 'develop' of https://github.com/rembo10/headphones into develop 2017-03-14 15:02:32 +02:00
Ade 519fdc3015 Merge branch 'develop' of https://github.com/rembo10/headphones into develop 2017-03-14 17:39:36 +13:00
Noam 91ed781acb More exception handling for torrent removal 2017-03-13 22:10:57 +02:00
AdeHub bf5d07efec Merge pull request #2871 from noam09/develop
Fix Qbittorrent config appearing while Deluge is selected + Deluge check if torrent seeding before removal
2017-03-14 07:11:29 +13:00
Noam 33fdb3d7bd Wrong variable name 2017-03-13 18:46:04 +02:00
Noam 3f67396a55 Deluge: check if torrent finished seeding before deleting 2017-03-13 18:32:36 +02:00
Noam 3680c2b349 Fix typo causing Qbittorrent config to show while Deluge is selected 2017-03-13 10:41:46 +02:00
Ade ff7ff79f85 Merge branch 'master' into develop 2017-03-13 11:11:20 +13:00
Ade debc65db5d Temp processing fixup
Fixes
2017-03-13 11:01:21 +13:00
Ade a02cc4d7b9 pep8 2017-03-12 17:19:21 +13:00
Ade 578ae2c2d8 More post processing artwork changes
- Added min/max pixel width config options
- Artwork < min width is ignored
- Artwork > max width is downsized to max width using a proxy web
service
2017-03-12 12:47:12 +13:00
AdeHub 85749c4e94 Merge pull request #2870 from noam09/develop
Added JSON-related HTTP headers
2017-03-12 09:13:39 +13:00
Noam e415de7698 Added JSON-related HTTP headers 2017-03-11 15:38:12 +02:00
Ade a9bbd34a52 more pep8 2017-03-11 12:44:13 +13:00
Ade 7797cd0681 pep8 2017-03-11 12:37:13 +13:00
Ade 9ccb0f85dc Use CAA artwork for post processing
Preference is:
CAA
Amazon
last.fm
2017-03-11 12:19:53 +13:00
Ade 50185ab3d3 Merge branch 'develop' 2017-03-11 09:04:37 +13:00
Ade 697e695f7d More temp dir stuff 2017-03-11 08:38:42 +13:00
Ade 36ad37f005 Don't check temp pp dir if forced 2017-03-10 11:47:36 +13:00
Ade a45894b802 Merge branch 'develop' 2017-03-09 11:51:47 +13:00
Ade dd1e4bfe3b Label change 2017-03-09 11:35:06 +13:00
Ade 88366443fd Post processing temp dir fixup
Hopefully fixes #2859
2017-03-09 11:10:06 +13:00
widewing 6a1aca66b1 change ajax call method to POST 2017-03-04 11:24:42 +13:00
MrClayPole ef6a203cda Update init.freebsd
This path is incorrect for freebsd the path to python bin is /usr/local/bin/python rather than /usr/bin/python
2017-03-04 11:24:42 +13:00
hypsometric 83c50ccd4f HTML escape pth_password 2017-03-04 11:24:42 +13:00
Fritsbenik 3e4c5cb5e2 update init.freebsd
Allow to set variables in /etc/rc.conf
2017-03-04 11:24:42 +13:00
Ade 8c1621f604 Merge branch 'master' of https://github.com/rembo10/headphones 2017-03-04 11:17:18 +13:00
Ade bc465edd91 Merge branch 'master' into develop 2017-03-04 11:08:06 +13:00
AdeHub 3d1a9e8947 Merge pull request #2851 from MrClayPole/patch-1
Update init.freebsd
2017-03-04 11:02:56 +13:00
AdeHub 9d6a7d1d36 Merge pull request #2855 from widewing/patch-1
change ajax call method to POST
2017-03-04 11:02:32 +13:00
widewing 3cfc434e8a change ajax call method to POST 2017-02-24 16:32:54 +08:00
MrClayPole e7017305d8 Update init.freebsd
This path is incorrect for freebsd the path to python bin is /usr/local/bin/python rather than /usr/bin/python
2017-02-21 08:54:24 +00:00
AdeHub a0fa658956 Merge pull request #2848 from hypsometric/patch-1
HTML escape pth_password
2017-02-17 19:33:34 +13:00
hypsometric 709073358b HTML escape pth_password 2017-02-14 15:37:59 +01:00
Ade e6b74be1f6 Replace Piratebay apostrophe
Fixes #2839
2017-02-02 19:46:31 +13:00
Ade c29dda3af6 Torznab
- Use 3050 for music/other
- Does not return size for Torrentech, hack our own
2017-01-22 10:22:19 +13:00
Ade 335586893c Keep original folder
- Added config option for directory to use when keeping folder for
seeding
- cue processing fixup
2017-01-22 10:17:24 +13:00
Ade 44bb1bea08 rutracker links and cookie changes 2017-01-21 19:45:00 +13:00
Ade 9f378ec79c kat domain change 2017-01-21 09:55:38 +13:00
Ade 5501d84611 omgwtfnzbs domain change
Fixes #2820
2017-01-21 09:52:12 +13:00
AdeHub 34746400e6 Merge pull request #2818 from Fritsbenik/patch-1
update init.freebsd
2017-01-21 09:38:39 +13:00
AdeHub cf502aa880 Merge pull request #2806 from Darkitty/develop
Add Slack notification
2017-01-21 09:38:03 +13:00
AdeHub 2ca498d74f Merge pull request #2811 from Gadzy/develop
T411 specific download bugfix
2017-01-21 09:37:12 +13:00
AdeHub 432018a2a4 Merge pull request #2822 from dsm1212/qbittorrent
Add qbittorrent downloader support
2017-01-21 09:35:36 +13:00
dsm1212 784ec2927e more pep8 fixes and a typo 2017-01-14 01:20:42 -05:00
root fa1cb27e04 fix pep8 errors 2017-01-14 01:13:04 -05:00
root 7e915c5902 Add qbittorrent downloader support 2017-01-14 00:49:55 -05:00
Fritsbenik 7f48b021ec update init.freebsd
Allow to set variables in /etc/rc.conf
2017-01-04 19:08:48 +01:00
Gadzy e8009c00d2 T411 specific dowload bugfix
Fixed a bug where T411 was not checked when choosing specific download
2016-12-22 21:43:06 +01:00
Nicolas Le Gall 772fb524c7 Fix for pep8 2016-12-18 10:39:26 +01:00
Nicolas Le Gall b538e5b321 Add Slack notification 2016-12-18 10:32:39 +01:00
Ade decc548086 PEP8 2016-12-11 19:23:38 +13:00
Ade 82695311c4 PEP8 2016-12-11 19:12:29 +13:00
AdeHub 6d40178ce2 Merge pull request #2790 from noam09/develop
Apollo replaces WCD, PTH object fix, Deluge logging tweak
2016-12-11 17:17:38 +13:00
Ade 4d1107ee54 cue sheet + temp dir fix ups
- cue not processing correctly if using temp dir
-  allow temp dir to be specified from new config option
- attempt to stop multiple temp dirs created for the same albumpath
2016-12-11 17:11:42 +13:00
Noam 8fd9958d70 Separated use of Gazelle objects for Apollo and PTH so that objects don't collide, renamed objects to make this clear 2016-12-02 14:20:28 +02:00
Noam f8900795da Replaced all instances of WCD with Apollo 2016-12-02 13:08:03 +02:00
Noam b8e8e752f0 RIP WCD 2016-12-02 12:13:07 +02:00
Noam d04cdcd8fa Merge branch 'develop' of github.com:noam09/headphones into develop 2016-12-02 12:07:04 +02:00
Noam edc243a245 Changed some logging to better understand issue #2734 2016-12-02 12:06:13 +02:00
rembo10 b71c0d8b93 v0.5.18 2016-12-01 15:59:35 +00:00
rembo10 0ecfe499fc Updated changelog for v0.5.18 2016-12-01 15:59:11 +00:00
rembo10 68d85841ea Merge remote-tracking branch 'DenzoNL/master' into develop 2016-12-01 15:52:46 +00:00
rembo10 1ffcc177a4 Merge remote-tracking branch 'MIKAd3v/develop' into develop 2016-12-01 15:51:01 +00:00
rembo10 2230c5bc0c Merge remote-tracking branch 'wfriesen/develop' into develop 2016-12-01 15:49:58 +00:00
Denzo 352b009e91 # Removed slash from ajax.php 2016-11-29 20:54:20 +01:00
Denzo b6b33e1b1e + Added support for PassTheHeadphones.me
% Removed hardcoding for What.CD in pygazelle API, making it easy to add other Gazelle-based trackers

+ Added URL parameter for What.CD and PTH, in case they come back under a new domain name
2016-11-29 20:49:52 +01:00
massiliattak dff1ac2e41 Update T411 new domain ( t411.li ) 2016-11-20 20:15:37 +01:00
Noam 36f75f44e9 Changed some logging to better understand issue #2734 2016-11-19 22:58:57 +02:00
William Friesen 92601e0eb8 Use HTML escaping for password fields
Fixes rembo10/headphones#2474
2016-11-19 12:15:22 +11:00
rembo10 6e82423947 Merge remote-tracking branch 'Betree/search_with_partial_dates' into develop 2016-11-10 21:07:04 +00:00
rembo10 0a805a01f3 v0.5.17 2016-11-10 20:58:00 +00:00
rembo10 579b5a2f2f Updated changelog for v0.5.17 2016-11-10 20:56:51 +00:00
Benjamin Piouffle c77f43be5e Accept partial release date for search 2016-10-25 19:21:16 +11:00
AdeHub f10d1834dd Merge pull request #2749 from likeitneverwentaway/t411
Fixed lossless only for t411
2016-10-20 22:51:42 +13:00
AdeHub b4c7ed2227 Merge pull request #2756 from Betree/fix_rutracker_login
Fix Rutracker loggin by looking for the cookie in request history
2016-10-20 22:51:23 +13:00
Benjamin Piouffle 0086980b1b Fix Rutracker loggin by looking for the cookie in request history 2016-10-19 12:41:46 +11:00
likeitneverwentaway 89e1793978 Fixed lossless only for t411 2016-10-15 14:39:55 +02:00
rembo10 5a598fe611 Merge remote-tracking branch 'etomm/develop' into develop 2016-10-15 10:13:20 +01:00
etomm b58f670694 Handling Deluge empty password 2016-10-15 10:08:51 +02:00
AdeHub 5103436d17 Merge pull request #2745 from likeitneverwentaway/t411
New provider : add t411 support
2016-10-15 18:58:41 +13:00
Ade c9a1796e56 Allow hyphen in mb search
Fixes #2499
2016-10-15 09:59:11 +13:00
Ade 7428b56dd5 Remove mb apostrophe
Fixes #2737
2016-10-09 15:56:25 +13:00
likeitneverwentaway 42294d261d Fix typo, import loads from json 2016-10-08 01:55:55 +02:00
likeitneverwentaway 31a99a908a Added credit 2016-10-08 01:08:54 +02:00
likeitneverwentaway aa503f0fe8 Update config.py to add t411 support 2016-10-08 01:01:39 +02:00
likeitneverwentaway d3d48d27df Update webserve.py to add t411 support 2016-10-08 01:00:49 +02:00
likeitneverwentaway bd8eb74662 Update config.html to add t411 support 2016-10-08 00:50:48 +02:00
likeitneverwentaway 99680e9a0f Update searcher.py to add t411 support 2016-10-08 00:46:12 +02:00
rembo10 0cc58bdb46 Merge remote-tracking branch 'clowninasack/freebsd-init-script' into develop 2016-09-28 22:37:17 +01:00
rembo10 09435b8786 Merge remote-tracking branch 'kainz/add_crier' into develop 2016-09-28 22:37:14 +01:00
rembo10 5d2753a34e Merge remote-tracking branch 'VoidVolker/develop' into develop 2016-09-28 22:37:01 +01:00
Ade 8eb3ece2f9 rutracker login fix
stop redirecting to the same login page
2016-09-17 20:27:01 +12:00
Get your own 'tots. Geez! ed923a2a94 Update config.html 2016-08-03 11:09:05 -06:00
Get your own 'tots. Geez! 95cc0670e2 Update config.html 2016-08-03 11:03:28 -06:00
Get your own 'tots. Geez! a62b55c40f Update importer.py 2016-08-03 10:52:39 -06:00
Get your own 'tots. Geez! 7440b77377 Update importer.py 2016-08-03 10:22:55 -06:00
Get your own 'tots. Geez! 372c6ffd3b Update config.html 2016-08-03 10:07:01 -06:00
Get your own 'tots. Geez! 14d1524971 Update config.html 2016-08-03 09:53:53 -06:00
Get your own 'tots. Geez! 9cddcabad4 Update webserve.py 2016-08-03 09:31:17 -06:00
Get your own 'tots. Geez! 656e7161cb Update config.py 2016-08-03 09:29:09 -06:00
Get your own 'tots. Geez! 7c12761066 Update config.py 2016-08-03 09:27:44 -06:00
clowninasack d3584a5ae9 Fixed FreeBSD init script. 2016-08-01 10:30:10 -07:00
Bryon Roche c0c64621e6 Add a thread-dumping handler
Add a 'crier' handler to dump the thread stacks of running threads to
the log, for easier debugging.
2016-07-14 05:34:36 -07:00
Bryon Roche 323d364572 Added missing support method for current FauxSocket for pypy 2016-07-14 05:27:07 -07:00
VoidVolker 9a681a9422 [=] HP_HOST description 2016-07-08 14:44:01 +03:00
VoidVolker a7a709df51 [+] HP_HOST option 2016-07-08 14:42:19 +03:00
VoidVolker 3f23b5553a [+] --host command line option 2016-07-08 14:39:36 +03:00
rembo10 5a2082ede5 v0.5.16 2016-06-10 00:23:22 +01:00
rembo10 e29f3a0a9a Updated changelog for v0.5.16 2016-06-10 00:22:59 +01:00
rembo10 f4bebf6a41 Merge remote-tracking branch 'SlashingWolf/patch-1' into develop 2016-06-10 00:20:43 +01:00
Gabriel 564df8136c Update to searcher.py to work with waffles.ch
Changed the url used for searching waffles from https://www.waffles.ch/browse.php to https://waffles.ch/browse.php.
2016-06-09 16:19:49 -05:00
rembo10 e85560952f v0.5.15 2016-06-07 10:53:10 +01:00
rembo10 5d6a4adae8 Updated changelog for v0.5.15 2016-06-07 10:50:13 +01:00
rembo10 ecfd3204ff Updated vip server url 2016-06-07 10:49:59 +01:00
rembo10 f0e6554309 Merge branch 'develop' of https://github.com/rembo10/headphones into develop 2016-06-07 10:48:50 +01:00
AdeHub 995294e605 Merge pull request #2666 from noam09/develop
Waffles move from .fm to .ch
2016-06-06 11:59:58 +12:00
Noam 0525493c99 Waffles move from .fm to .ch 2016-06-05 14:39:19 +03:00
rembo10 df2b56c985 v0.5.14 2016-06-02 23:44:15 +01:00
rembo10 e168305e64 Updated changelog for v0.5.14 2016-06-02 23:44:07 +01:00
rembo10 c3b6d5c0ca pep8 fix for E122 2016-06-02 23:34:39 +01:00
rembo10 60a1aaa3ab Merge remote-tracking branch 'maxkoryukov/fix/website-link' into develop 2016-06-02 23:25:39 +01:00
rembo10 f1d14ce6e2 Merge remote-tracking branch 'YipYup/master' into develop 2016-06-02 23:25:06 +01:00
rembo10 c246d522f9 Merge remote-tracking branch 'maxkoryukov/feature/font-awesome-4.6.1' into develop 2016-06-02 23:13:59 +01:00
rembo10 ba4ed12ec8 Merge remote-tracking branch 'maxkoryukov/feature/unittestcompat-assert-items-equal' into develop 2016-06-02 23:13:34 +01:00
rembo10 8d89da6270 Merge remote-tracking branch 'satreix/pep-e121,122' into develop 2016-06-02 23:13:16 +01:00
rembo10 b8667bbe30 Merge remote-tracking branch 'satreix/pep-e124e125' into develop 2016-06-02 23:09:21 +01:00
rembo10 331da61f5a Merge remote-tracking branch 'satreix/pep-e265' into develop 2016-06-02 23:08:07 +01:00
rembo10 4251b0ce59 Merge remote-tracking branch 'goobags/patch-2' into develop 2016-06-02 23:06:56 +01:00
rembo10 43b41e5f1f Merge remote-tracking branch 'maxkoryukov/fix/less' into develop 2016-06-02 23:05:24 +01:00
rembo10 e12eb23cae Merge remote-tracking branch 'maxkoryukov/fix/unittestcompat-method-doc' into develop 2016-06-02 23:04:27 +01:00
rembo10 041dbeda46 Fixed folder format/file format on new installs 2016-06-02 22:49:35 +01:00
maxkoryukov 9a0cb32902 add link to the fork on github to the main page 2016-05-30 09:23:41 +05:00
maxkoryukov 1c783ee6d1 fixes for github-url on main 2016-05-30 09:12:28 +05:00
Get your own 'tots. Geez! d82e5585f5 Update postprocessor.py 2016-05-24 18:40:43 -06:00
goobags 847b24557a Update __init__.py 2016-05-06 20:43:55 +10:00
maxkoryukov d7b91da8fd UPG: Font Awesome 4.6.1 2016-04-19 08:45:56 +05:00
maxkoryukov a5ab2e4080 UGP: improved unittestcompat. assertItemsEqual added 2016-04-13 14:57:18 +05:00
satreix eb6df45b00 pep: fix e121 and e122 2016-04-10 11:33:22 -07:00
satreix 873d1fac94 pepx: fix e124 and e125 2016-04-09 00:13:49 -07:00
satreix b5f0e0fdcb pep: fix e265 2016-04-09 00:06:50 -07:00
AdeHub cf42836c95 Merge pull request #2597 from andrzejc/develop
metadata: Additional protection against NPEs
2016-04-08 18:43:08 +12:00
Andrzej Ciarkowski 75861d7172 metadata: Additional protection against NPEs 2016-04-07 18:12:07 +02:00
rembo10 4dfe91aedb Merge remote-tracking branch 'msh100/develop' into develop 2016-04-05 13:51:39 +01:00
rembo10 6b6dd6fbf6 Fix pep8 issue in helpers_test and fix import re #2574 2016-04-05 12:34:45 +01:00
rembo10 774b3fdf08 Merge remote-tracking branch 'maxkoryukov/fix/sofchroot-tmp-remove' into develop 2016-04-05 12:27:44 +01:00
rembo10 a1d93936f3 Merge remote-tracking branch 'satreix/travis' into develop 2016-04-05 12:12:27 +01:00
rembo10 778deb9674 Merge remote-tracking branch 'bfred-it/patch-1' into develop 2016-04-05 12:08:15 +01:00
rembo10 20e1954f0c Merge remote-tracking branch 'satreix/pep-e261' into develop 2016-04-05 12:06:45 +01:00
rembo10 b894ebb3c5 Merge remote-tracking branch 'andrzejc/clean-name' into develop 2016-04-05 12:04:44 +01:00
rembo10 db3df7e6c9 Merge remote-tracking branch 'andrzejc/metadata' into develop 2016-04-05 12:03:15 +01:00
rembo10 658ae4a587 Merge remote-tracking branch 'andrzejc/pathrender' into develop 2016-04-05 12:02:59 +01:00
rembo10 1e873d7e97 Merge remote-tracking branch 'satreix/pep-e262' into develop 2016-04-05 12:01:34 +01:00
rembo10 cd77bb827b Merge remote-tracking branch 'satreix/pep-e502' into develop 2016-04-05 11:57:48 +01:00
rembo10 35230a0674 Merge remote-tracking branch 'andrzejc/develop' into develop 2016-04-05 11:56:22 +01:00
Marcus Stewart Hughes 8be316d87c Fix typo with Musicbrainz 2016-04-03 11:24:39 +01:00
rembo10 c1d18a278d Merge remote-tracking branch 'noam09/develop' into develop 2016-03-29 22:11:21 +01:00
maxkoryukov 826c6b1036 full name for headphones.exceptions.SofChrootError 2016-03-20 17:10:29 +05:00
maxkoryukov e1eab37502 FIX: full name of headphones.exceptions for softchroot 2016-03-20 17:02:46 +05:00
maxkoryukov 56a9c62bcb FIX: fix style.less 2016-03-20 17:02:46 +05:00
maxkoryukov a25ebdccfb FIX: bug with fullname of headphones.exceptions, visible just for pyflakes... 2016-03-20 16:48:56 +05:00
goobags 8940a14666 Update __init__.py
V2 aiff lossless file inclusion
2016-03-20 15:01:59 +11:00
satreix 4e7d197c7f travis: better pip usage 2016-03-18 23:24:38 -07:00
maxkoryukov 7dc6c98e56 FIX: style.less 2016-03-13 02:22:16 +05:00
maxkoryukov 5bbb9aa5e6 FIX: style.less (additionally : style.css) 2016-03-13 02:19:14 +05:00
maxkoryukov 9a0713cedb FIX: fix style.less 2016-03-13 02:11:37 +05:00
maxkoryukov 43d37b875f FIX: unittestcompat now support tests without python-doc.
That was an ugly bug...
2016-03-12 18:29:27 +05:00
Andrzej Ciarkowski 33baf66371 pathrender: Update explanation text. 2016-03-09 21:03:37 +01:00
Federico Brigante 5693e509b4 Custom build badges in readme 2016-03-08 19:54:43 -08:00
Noam 479a9548c1 Set Move-To Path for General Setting
- setTorrentPath was called only in case DELUGE_DONE_DIRECTORY was set,
forgot about the more general DOWNLOAD_TORRENT_DIR option. Thought about
it in deluge.py, forgot about it in searcher.py. This should fix #2557
2016-03-09 00:01:05 +02:00
satreix f1e7078902 pep: fix e261 2016-03-04 12:47:51 -08:00
Noam 9b9d728ce3 Deluge Move-To Directory
- Deluge move-to directory only relevant if Deluge is the chosen torrent
downloader
2016-03-04 17:44:44 +02:00
Noam 5bf465b883 Go Back to Previous Folder Name
- Go back to previous folder name method
2016-03-04 15:29:52 +02:00
Andrzej Ciarkowski fd8fb4529c helpers: Replace cleanName() implementation to get much higher match ratio.
Track matching is performed using 'CleanName' which up to now was obtained in
convoluted way, which effectively removed any non-ascii alphanumeric characters
but at the same time left some trash preventing the names to be matched due to
whitespace differences. Current implementation performs most of the
transliteration using Unicode NFD decomposition to remove diacritical marks from
characters in Latin scripts, leaving the others intact. Only alphanumeric chars
are included in resulting string and all the spaces are coalesced. Based on
observations on several-tens GiB library, this allows for much better ratio of
automatic track matches.
2016-03-04 11:25:16 +01:00
Noam e05699e7ba Specify Name When Sending to Deluge Module
- Searcher should send "Artist - Album" string to Deluge so we don't
have to guess the name
2016-03-03 14:37:55 +02:00
Noam 147f62d87a Removed Folder Name
- Folder name (folder_name) is set to Artist - Album by default - use
that instead
2016-03-03 14:23:12 +02:00
Andrzej Ciarkowski c9a6125d92 __init__.py: Fix pyflakes failing due to invalid use of headphones.exceptions. 2016-03-03 08:51:24 +01:00
Noam 30a3421710 More Travis
- Not sure what this is but I think this should fix it...
2016-03-02 23:32:13 +02:00
Noam a7f2329fee Travis Fixes 2016-03-02 23:19:30 +02:00
Noam 1a56e24def Added SSL/TLS Disclaimer
- Currently self-signed certificates can't be verified
2016-03-02 15:35:20 +02:00
Noam 73a55e81b8 Better Downloading of Files
- Reading downloaded files now uses response.content instead of
response.text which caused loss of file data due to encoding
shenanigans. This fixes the WHAT issue.
- Fix URL for WFFLS downloads
- Special User-Agent for WHAT downloads, still not sure if this is
necessary
2016-03-02 15:12:18 +02:00
Noam ac91e17f86 More Special Sites 2016-03-01 23:39:38 +02:00
Noam 69405d4f0d Let Deluge Handle Certain Downloads
- Use Deluge's web.download_torrent_from_url for specific sites
2016-03-01 14:54:29 +02:00
Noam aff82e4755 Always Authenticate When Adding Torrents
- Avoid expired session cookies, just authenticate always
2016-03-01 13:16:33 +02:00
Noam a8476e89f4 Log User-Agent Switch 2016-03-01 12:17:13 +02:00
Noam 3ac15d880f Scrub Local Windows User Path
- Scrub Windows user path from logs
2016-03-01 10:40:22 +02:00
Noam 8ead17e25e Try Different User-Agent for Specific Sites
- DLing not working for some users, possibly because of the site - maybe
a different UA will make a difference
- Make links lowercase before testing them for content
2016-03-01 10:15:36 +02:00
Noam 9e943a9681 Handle ConnectionError Properly
- except requests.ConnectionError...
2016-02-29 16:26:34 +02:00
Noam b89dcfde65 More Scrubbing and Logging and Auto-Switch to HTTPS
- If Deluge is set to use HTTPS but there is no certificate configured
in HP, use HTTPS without verifying the certificate - connection will
still be encrypted but the certificate won't be validated - this will
show up as an ERROR in the logs
- Scrubbing session cookies
2016-02-29 13:45:30 +02:00
Noam c166e36c4e Log Scrubber
- Attempt to remove sensitive information from logs
2016-02-29 11:54:35 +02:00
Noam 2c9c4d32db Another Fix For Encoding Issues
- Apparently some torrents are already proper UTF8 so we don't need to
encode them...
2016-02-28 22:48:37 +02:00
Noam 06ae4e97a0 Handle UnicodeDecodeError
- Attempt at handling encoding errors with specific torrent files
2016-02-28 16:47:17 +02:00
Noam e2097fdb31 Expanded SSL Description 2016-02-28 13:42:34 +02:00
Noam ef08a50673 Deluge SSL and More Logging
- Added option to use Deluge WebUI SSL using certificate file path
- Added logging in order to understand other bugs
2016-02-28 12:37:44 +02:00
Andrzej Ciarkowski 97e405ee8c metadata.py: Use arbitrary variables from existing tags or database in renamer.
This commit adds the possiblity to use variables from tags already present in
the downloaded media files in file, folder and album art renaming routines. The
variable names translate directly to MediaFile field names, so it is now
possible to use variables like $mb_albumid, $genre, $bitrate, $samplerate, etc.
The full list can be read from MediaFile.readable_fields().
2016-02-27 18:34:05 +01:00
Andrzej Ciarkowski 55eed7c378 pathrender: Add unit tests module for pathrender.py 2016-02-27 17:09:29 +01:00
Noam 85f5dcf2cb Merge remote-tracking branch 'refs/remotes/rembo10/develop' into develop 2016-02-27 12:59:26 +02:00
satreix a4c9990df1 pep: fix e262 2016-02-26 19:33:30 +01:00
satreix 72b764cc51 pep: fix e502 2016-02-26 19:25:21 +01:00
Andrzej Ciarkowski 7e9bd432ce postprocessor.py: Safeguard against lack or ReleaseDate in metadata 2016-02-26 17:48:55 +01:00
rembo10 4b80e2b39b v0.5.13 2016-02-25 19:44:11 +00:00
rembo10 0ac947099c Updated changelog for v0.5.13 2016-02-25 19:24:19 +00:00
rembo10 37a086d58d Possible fix for #2530 & #2526 2016-02-25 17:54:25 +00:00
rembo10 130cf51cc6 Fixed .pep8 for travis build (v0.5.12) 2016-02-25 17:30:55 +00:00
rembo10 7e4a1e453b Revert "Took out E123 from .pep8"
This reverts commit 56de4c63a7.
2016-02-25 17:29:43 +00:00
rembo10 9c946b69e1 v0.5.12 2016-02-25 17:25:15 +00:00
rembo10 61ad94c0a0 Updated changelog for v0.5.12 2016-02-25 17:24:50 +00:00
rembo10 56de4c63a7 Took out E123 from .pep8 2016-02-25 17:23:41 +00:00
rembo10 1dfa31c275 Merge remote-tracking branch 'satreix/feat-pep-e302' into develop 2016-02-25 17:17:07 +00:00
rembo10 e16087eb54 Merge remote-tracking branch 'satreix/feat-pep-e111' into develop 2016-02-25 17:14:55 +00:00
rembo10 289293f23b Merge remote-tracking branch 'satreix/develop' into develop 2016-02-25 17:14:46 +00:00
rembo10 59112c1a83 Changed optional values for pathrender to use curly braces 2016-02-25 17:12:30 +00:00
satreix dd30ed460d pep: fix E111 2016-02-25 12:33:38 +01:00
satreix bc54b5abaf pep: fix E302 2016-02-25 12:24:06 +01:00
satreix 05d316615a pep: fix commenting 2016-02-25 11:15:24 +01:00
rembo10 0eb8702a8e Merge remote-tracking branch 'andrzejc/develop' into develop 2016-02-25 00:58:01 +00:00
rembo10 dfc6a6f93a Merge remote-tracking branch 'noam09/develop' into develop 2016-02-25 00:56:40 +00:00
Noam 1bb0b3c9bf No Need For Deluge Username
- Removed username configuration option, unneeded
2016-02-24 17:14:14 +02:00
Andrzej Ciarkowski 89d5649b4f config.html: Add explanation text for optional elements and single-quote escapes
This is follow up to the change introducing "pathrender.py" and extended path
formatting syntax.
2016-02-22 20:19:28 +01:00
rembo10 4b3b8d2795 v0.5.11 2016-02-20 21:19:03 +00:00
rembo10 eeff731858 Updated changelog for release 2016-02-20 21:18:54 +00:00
rembo10 63abd73942 Merge remote-tracking branch 'andrzejc/date-in-patterns' into develop 2016-02-20 21:12:06 +00:00
rembo10 c74bec2d29 Merge remote-tracking branch 'andrzejc/transmission-session-id' into develop 2016-02-20 21:10:55 +00:00
Noam bd74d21c83 Moved Around Torrent-Type Checking
- From local/data->URL>magnet to magnet->URL->local/data. I feel stupid.
2016-02-19 11:38:37 +02:00
Noam 41aee3d6bb Encode UTF-8 Before Base64ing
- I was using UTF-8 when I started out, don't know why I changed it back
then... Oh well, hopefully this solves the encoding problems (note to
self: you can't base64 unicode)
2016-02-18 19:35:48 +02:00
Noam 396e75ed2d Exception Debugging
- Add traceback output to log
2016-02-18 17:02:44 +02:00
Andrzej Ciarkowski 769e9c1730 postprocessor.py: Allow $Date variable in file/folder name patterns.
Also lowercase variant $date, both resolve to the same field ReleaseDate taken
from metadata.
2016-02-17 22:46:46 +01:00
Andrzej Ciarkowski 33d38f33e5 transmission.py: Don't request session id in subsequent requests.
If session id from previous request to Transmission is present, try using it and
retry the request with new session id only if the first try fails with status
code 409. This will decrease number of required requests by half.
2016-02-17 22:26:48 +01:00
Noam 876b6402c4 Better URL Checking and Logging
- Improved if/else so that URLs won't end up in the file/data opener
- Log torrent file content
2016-02-17 17:55:46 +02:00
Noam 0e334a8f92 Label Debugging
- Labels not set properly, need log
2016-02-17 17:28:19 +02:00
Noam 6218734783 Encoding Change and More String Formatting
- Try base64 encoding utf-8 if ascii fails
- More string formatting
2016-02-17 17:22:59 +02:00
Noam da5ac9757a Remove requests iter_content
- inter_content might have been the reason for repeated encoding issues
- let's try with good old r.text
2016-02-17 16:20:37 +02:00
rembo10 36107c11d5 Merge remote-tracking branch 'YipYup/WebMosher-patch-for-issue-2485' into develop 2016-02-17 12:15:27 +00:00
Noam 5adf684dbe More Logging
- Adding torrent by URL via Deluge still commented out because it
doesn't work with all links (probably because of user-agent)
- String formatting
- Removed debug bits
- Log exceptions
2016-02-17 10:58:29 +02:00
Get your own 'tots. Geez! 6bc3adbd33 Resolve image caused uncaught exception.
Implement Webmoshers ( https://github.com/webmosher ) fix for issue #2485 per https://github.com/rembo10/headphones/issues/2485#issuecomment-180047097
2016-02-16 14:14:41 -07:00
Noam c445a0732f Added Logging
For debugging
2016-02-16 22:06:49 +02:00
Noam 20baed87ff More debugging 2016-02-16 21:18:54 +02:00
Noam ef9a2015eb Added debugging for tests and fixed setTorrentPause 2016-02-16 21:04:56 +02:00
rembo10 583c71eca3 Merge remote-tracking branch 'maxkoryukov/fix/unittestcompat' into develop 2016-02-16 12:17:16 +00:00
maxkoryukov 1e3c3c8f6c Fix unittestcompat 2016-02-16 06:46:12 +05:00
rembo10 0a36166317 Merge remote-tracking branch 'andrzejc/develop' into develop 2016-02-15 23:57:13 +00:00
rembo10 661f01319c Revert "Update frontend libs"
This reverts commit 9cb8379c2d.
2016-02-15 23:38:51 +00:00
Andrzej Ciarkowski 6f8941d7be helpers.py: Fix replace_all() broken by commit not in sync 2016-02-16 00:23:27 +01:00
rembo10 f7116edc9a Merge remote-tracking branch 'maxkoryukov/feature/softchroot' into develop 2016-02-15 22:39:50 +00:00
rembo10 ea69d56ab4 Merge remote-tracking branch 'andrzejc/pathrender' into develop 2016-02-15 22:12:36 +00:00
rembo10 223e129477 Merge remote-tracking branch 'andrzejc/develop' into develop 2016-02-15 22:10:29 +00:00
rembo10 4a5674a679 Merge remote-tracking branch 'maxkoryukov/fix/css-select-beauty' into develop 2016-02-15 22:09:52 +00:00
rembo10 91c3a81cb1 Merge remote-tracking branch 'maxkoryukov/feature/test-config' into develop 2016-02-15 22:09:00 +00:00
rembo10 e6921730c0 Merge remote-tracking branch 'andrzejc/fix-spurious-tmp-dirs' into develop 2016-02-15 22:08:05 +00:00
rembo10 89ef0636a8 Merge remote-tracking branch 'maxkoryukov/feature/cache-travis' into develop 2016-02-15 21:43:35 +00:00
rembo10 769ef001ec Merge remote-tracking branch 'maxkoryukov/feature/six-1.10' into develop 2016-02-15 21:41:12 +00:00
rembo10 44b8ac79da Merge remote-tracking branch 'hamiltont/patch-4' into develop 2016-02-15 21:40:19 +00:00
rembo10 5ada65b2a0 Merge remote-tracking branch 'Uncreate/patch-1' into develop 2016-02-15 21:39:14 +00:00
rembo10 e433e7eda1 Merge remote-tracking branch 'JamieMagee/update-frontend-libs' into develop 2016-02-15 21:34:53 +00:00
Andrzej Ciarkowski 7de7dea1da webserve.py: Fix scanning artists with non-ASCII letters in folder names.
This patch prevents exceptions from os.path.isdir() called with unicode folder names.
2016-02-15 21:59:10 +01:00
Noam 86fb9bbd6c Update README.md
Deluge support
2016-02-14 18:56:10 +02:00
maxkoryukov 159474cf9b Improved CSS for 'select' tags. Now they looks similar to submit-buttons.
No more ugly rectangles!!
2016-02-14 20:01:55 +05:00
Noam a2e7d4bdd1 Base64 Encode Received Torrent Binary and Updated Credits
- Instead of base64-encoding the torrent binary data for each method
(data/file/url/link), _add_torrent_file receives binary data and base64
encodes it
- Today I found out SickRage split into two groups somewhere along the
way (https://github.com/SickRage/sickrage-issues/issues/3), and since I
used parts of the code from SickRage I thought the credits in the file
should reflect its true author
2016-02-14 15:08:56 +02:00
maxkoryukov b143a942ae Unittests for config.py 2016-02-14 16:56:59 +05:00
Noam c446dc263a Add Problematic URL to Debug 2016-02-14 11:31:23 +02:00
Noam 60f718c2ce Temporary Debugging
Print source of exception
2016-02-14 11:28:06 +02:00
Noam 05df81be2f Travis
Not sure why Travis failed, let's try again
2016-02-13 12:17:00 +02:00
Noam 92cd62f0e9 Removed b64encode Import
Already importing all of base64, silly me
2016-02-13 12:07:24 +02:00
Noam 602dfbabc2 Encoding issues
- UTF-8 encoding/decoding issues, removed conversion (for now...)
- Noticed I was accidentally base64-encoding already-based64-encoded
torrents
2016-02-13 00:41:15 +02:00
Noam c492a4122c Travis fixes
- Whitespace
- Old variable name
2016-02-12 15:59:47 +02:00
Noam fd55e84274 Try to Download and Parse Torrents if Receives URL
Deluge module will attempt to download any http(s) links it receives
2016-02-12 13:16:22 +02:00
Uncreate dba264cc5f Update init.ubuntu 2016-02-09 18:06:16 -06:00
Andrzej Ciarkowski 7ff27a42ca pathrender.py: Add module for extended path formatting
The pattern matching is loosely based on foobar2000 pattern syntax, i.e. the
notion of escaping characters with ' and optional elements enclosed in square
brackets [] is taken from there while the substitution variable names are
Perl-ish or sh-ish. The following syntax elements are supported:
 * escaped literal strings, that is everything that is enclosed within single
   quotes (like 'this');
 * substitution variables, which start with dollar sign ($) and extend until
   next non-alphanumeric+underscore character (like $This and $5_that).
 * optional elements enclosed in square brackets, which render nonempty value
   only if any variable or optional inside returned nonempty value, ignoring
   literals (like ['['$That']' ]).
2016-02-09 17:16:28 +01:00
Andrzej Ciarkowski 8e1aa18b8f postprocessor.py: Delete the proper temp dir after postprocessing
Fix for the bug leaving spurious temp dirs after each album processing, due to
headphones trying to rmtree the subdirectory instead of the temp dir itself.
2016-02-05 14:54:43 +01:00
maxkoryukov 99cab7304d ignore .coverage.yml 2016-02-04 22:50:37 +05:00
Noam b5a9d52592 Fixed Whitespace Again
- Oh Travis...
2016-02-04 16:17:27 +02:00
Noam ca36938a83 Removed Whitespace
- Travis stuff
2016-02-04 16:10:22 +02:00
Noam de9d77a8ef Renames Cleanups and Torrent Removal Function
**Changes:**
- Modified function names to adhere to policy
- Removed/commented unused elements
- Added torrent removal function
2016-02-04 15:48:53 +02:00
Noam 0c3ebfbbb3 Exception handling for torrent name regular expression
Fall back to the torrent file's name in case reular expression
extraction method from the torrent file doesn't work.
2016-02-04 14:05:12 +02:00
maxkoryukov c575b861ed Soft Chroot for Headphones 2016-02-04 04:13:27 +05:00
Noah Manning 8323649c10 Added Deluge (Downloader) and Telegram (Notifier) Support
**Features:**
- - Added the ability to use Deluge as a torrent downloader
(http://deluge-torrent.org/)
- - Added the ability to use Telegram messenger for download
notifications using Telegram's Bot API (https://core.telegram.org/bots)

**Issues:**
- - Post-processor doesn't look for the right directory when scanning
for completed downloads, it looks for the torrent's official name and
not the actually directory it was saved to
2016-02-03 17:32:50 +02:00
maxkoryukov 0dd84fad78 pep8 2016-02-03 18:37:50 +05:00
maxkoryukov 7dc25b3d33 improved testing crutches for python 2.6 2016-02-03 18:35:16 +05:00
maxkoryukov 5599e736ba improved testing crutches for python 2.6 2016-02-03 18:32:02 +05:00
maxkoryukov e4e9a6b493 bug in test 2016-02-03 18:25:57 +05:00
maxkoryukov c50ee144df pep8 2016-02-03 18:24:32 +05:00
maxkoryukov f5f32d902b SoftChroot module done 2016-02-03 18:19:35 +05:00
maxkoryukov f993d371a6 Improved testing approach (many testcases in decorators) 2016-02-03 18:19:18 +05:00
maxkoryukov b5fb769bff improved test compatability 2016-02-03 06:59:10 +05:00
maxkoryukov 28cbf6d803 pep8 and pyflakes 2016-02-03 06:52:35 +05:00
maxkoryukov 89ddd937b0 pep8-fy tests 2016-02-03 06:44:25 +05:00
maxkoryukov 5da950f61b * improved unitesting (compat level for python 2.6 and unittest)
* preparation for SoftChroot (stubs and mocks)
2016-02-03 06:30:09 +05:00
maxkoryukov 7bff1b6c3c fuckin python 2.6 2016-02-03 03:57:23 +05:00
maxkoryukov 2baadd19cf fixed travis matrix and tests 2016-02-03 03:53:49 +05:00
maxkoryukov 2852aadc71 Compability with 2.6 unittests.. looks like a dogs poops 2016-02-03 03:50:53 +05:00
maxkoryukov 32e1854e13 Fixed tests Part 2. Me vs. PyFlakes 2016-02-03 03:35:04 +05:00
maxkoryukov b31daaa657 Fixed tests 2016-02-03 03:29:02 +05:00
maxkoryukov 2401fc46ba Merge branch 'feature/softchroot' of https://github.com/maxkoryukov/headphones into feature/softchroot
Conflicts:
	.travis.yml
	headphones/config_test.py
2016-02-03 03:23:06 +05:00
maxkoryukov 0957d2d957 Fixed tests 2016-02-03 03:21:52 +05:00
maxkoryukov f8df9c502b travis: Coverall installing 2016-02-03 03:07:23 +05:00
maxkoryukov 52f071d8b0 Update config_test.py 2016-02-03 03:04:19 +05:00
maxkoryukov a175ec5b5c ignore coverage temporary files
removed "exclude-dirs" from setup.cfg. Travis still cant work with nose-plugins
2016-02-03 02:58:28 +05:00
maxkoryukov f32ee0a9be Merge branch 'feature/cache-travis' into feature/softchroot 2016-02-03 02:53:48 +05:00
maxkoryukov f93702b82c cache for pip on TravisCI 2016-02-03 02:44:29 +05:00
maxkoryukov 0d4b006537 setup.cfg without RedNose 2016-02-03 02:40:25 +05:00
maxkoryukov 3f8477a442 Pep8 styling 2016-02-03 02:36:26 +05:00
maxkoryukov bc9143b2a2 Travis sends coverage 2016-02-03 02:35:54 +05:00
maxkoryukov 16c553196c Default settings for nosetests (+colors +coverage) 2016-02-03 02:35:08 +05:00
maxkoryukov b063ba412f * Dummy test , example for albumart. Required for precise coverage 2016-02-03 02:34:32 +05:00
maxkoryukov aa406f191a Merge branch 'feature/six-1.10' into feature/softchroot 2016-02-02 17:01:58 +05:00
maxkoryukov f63b0cab81 six.py upgraded to 1.10.0 2016-02-02 16:56:34 +05:00
maxkoryukov beacc6ed1e Prototype for test file 2016-02-02 16:54:04 +05:00
maxkoryukov 028cfaa44c Class config.path has been added. All setting reviewed and tuned 2016-02-02 16:45:37 +05:00
maxkoryukov ac2949cf88 Merge pull request #3 from rembo10/develop
sync upstream
2016-02-01 15:38:56 +05:00
maxkoryukov a098fae0f8 Merge pull request #2 from rembo10/master
sync upstream
2016-02-01 15:37:45 +05:00
Hamilton Turner 960e1f473f Make travis builds faster
Headphones does not require a full virtual machine, it can run using 
Travis-CI's container infrastructure which has higher limits and is 
faster
2016-01-30 13:32:36 -05:00
rembo10 ffd72ed6f7 Fixed ubuntu init script as per #2446 2016-01-29 16:45:08 +00:00
rembo10 5eeab858d1 v0.5.10 2016-01-29 16:30:40 +00:00
rembo10 f64045168d Updated changelog for v0.5.10 2016-01-29 16:29:53 +00:00
rembo10 f16d977e9b Removed pylint from travis 2016-01-29 16:19:45 +00:00
rembo10 8274a69236 Testing build status 2016-01-29 16:09:03 +00:00
rembo10 ce9f48e3d5 Moved build status to the top 2016-01-29 15:59:50 +00:00
rembo10 69735bdb22 Merge remote-tracking branch 'hamiltont/patch-2' into develop 2016-01-29 15:43:04 +00:00
rembo10 f3e2143b4b Revert "Add Python, Windows, OS X, and Linux to .gitignore"
This reverts commit 74e071b1d7.
2016-01-29 15:39:07 +00:00
rembo10 2110eb9855 Revert "Migrate as much as possible to pip and requirements.txt"
This reverts commit 982594a4a5.
2016-01-29 15:38:12 +00:00
rembo10 3c015990c5 Revert "Add versions, and point to rembo10 fork of musicbranizngs"
This reverts commit 456b441210.
2016-01-29 15:37:56 +00:00
Hamilton Turner 0d3026b97d Add Travis-CI badge to Readme 2016-01-24 15:09:32 -05:00
Jamie Magee 9cb8379c2d Update frontend libs 2016-01-06 23:48:51 +01:00
rembo10 33c8ea7e2b Fixed some pep8 & pyflakes errors 2015-12-21 15:28:44 -08:00
rembo10 561bed9fed Merge conflicts 2015-12-21 15:12:43 -08:00
rembo10 7bdfa6a59d Merge remote-tracking branch 'HammyHavoc/patch-1' into develop 2015-12-21 15:02:27 -08:00
rembo10 b887a941bf Merge branch 'pip-test' into develop 2015-12-21 15:00:46 -08:00
Valentin Tolmer b76f5250a8 postprocessor: use a temporary folder 2015-12-21 02:22:32 +01:00
Hammy Havoc e372369b9e Added a comma
Sentence begins with a conjunctive, needs a comma following independent clause.
2015-12-18 14:20:38 +00:00
rembo10 aaa0ea23e2 Merge remote-tracking branch 'kooimens/patch-1' into develop 2015-12-04 17:21:26 -08:00
rembo10 f8fe2cd532 Merge remote-tracking branch 'JamieMagee/pip' into develop 2015-12-04 17:20:42 -08:00
kooimens bb362325ad Should do the trick
Use album_dir as leading parameter. Else 'dir' and if not specify just post process
2015-12-05 00:21:53 +01:00
kooimens 56555ad550 Add API ability to postprocess single album folder 2015-12-04 23:08:52 +01:00
Jamie Magee 456b441210 Add versions, and point to rembo10 fork of musicbranizngs 2015-12-04 11:09:09 +01:00
Jamie Magee 982594a4a5 Migrate as much as possible to pip and requirements.txt 2015-12-04 11:09:09 +01:00
rembo10 eaded8dfd9 Merge conflicts from lepricon49/master 2015-12-01 12:07:18 -08:00
rembo10 c583b95ee2 Merge remote-tracking branch 'JamieMagee/gitignore' into develop 2015-12-01 11:30:01 -08:00
rembo10 cda57dd733 Fixed some merge conflicts 2015-12-01 11:29:25 -08:00
rembo10 60fbfce540 Merge remote-tracking branch 'JamieMagee/init-scripts' into develop 2015-12-01 10:13:24 -08:00
rembo10 d8af2eaf4c Merge remote-tracking branch 'BillyNate/track-matching-patch' into develop 2015-12-01 10:12:18 -08:00
rembo10 9a571988ae Merge remote-tracking branch 'jvs3/master' into develop 2015-12-01 10:11:04 -08:00
rembo10 b5b81a8bba Merge remote-tracking branch 'botez/patch-1' into develop 2015-12-01 10:09:09 -08:00
rembo10 e76551b4a8 Merge remote-tracking branch 'theguardian/master' into develop 2015-12-01 10:05:51 -08:00
Jamie Magee 74e071b1d7 Add Python, Windows, OS X, and Linux to .gitignore 2015-11-27 14:10:08 +01:00
Jamie Magee 327585327f pep8, pyflakes, and pylint suggested fixes 2015-11-27 13:55:11 +01:00
Jamie Magee 4b445ca4df Make ShellCheck suggested changes 2015-11-27 10:48:04 +01:00
Ade ef4a844233 rutracker fix 2015-11-14 16:02:31 +13:00
Nate 80515658b0 Fixed a bug in track matching where only progress exactly divisible by 10 was displayed
Bug prevented progress from being properly displayed on albums with a track count not divisible by 10
2015-11-05 14:38:19 +01:00
jvs3 e7d7dc6b6b Added the option to provide an extension when using 'Advanced Encoding' instead of using the extension of the format selected in 'Audio Properties'. 2015-10-22 22:21:36 +02:00
theguardian aae0476967 check for affected python versions 2015-10-22 08:53:43 -07:00
theguardian aa6cf97324 made requested fixes 2015-10-22 07:58:57 -07:00
Troy Olson 8506671c5c Add fix for Ξ (capital 'Xi') for the band CHVRCHΞS
I'm guessing there aren't too many other bands that this will apply to.  Hex code found here:
http://webdesign.about.com/od/localization/l/blhtmlcodes-gr.htm
2015-10-21 13:33:02 -07:00
theguardian 022976d2f6 added verify_ssl_cert option to fix broken ssl installs 2015-10-20 21:52:55 -07:00
Ade 18d53167d0 utorrent torrents not being removed, fix #2385 2015-10-08 21:48:39 +13:00
Ade 9519bfddd4 torznab to transmission fix 2015-10-06 19:32:55 +13:00
Ade 0c556e32fa Strike whitelist 404 2015-09-23 20:58:10 +12:00
Ade f9a02d9b3b Get folder name working in history
+ show magnet as torrent
2015-09-18 18:16:39 +12:00
Ade 3b6c986704 More torcache fixes
- reverted back to rss for kat so we can use magnet links instead of
torcache link for transmission, utorrent. Also now uses the kat
’lossless’ category instead of going out to torcache to check for flac.
- added torcache referer for blackhole
2015-09-14 21:31:38 +12:00
lepricon49 c78e8764a0 Add snatched email indicator prefix
Prefix subject with "Snatched: " to make it more apparent that it is not
the final download email notification.
2015-09-13 10:57:14 -07:00
lepricon49 7f4d10c85d Add magnet support for KAT rTorrent via blackhole
KAT torrents downloads were 100% broken. This is a temporary hack to get
KAT partially working.
2015-09-13 10:54:05 -07:00
lepricon49 6b30ed0ba6 Stop JS links from scrolling to the top of the page
Changed all Using href="#" to href="javascript:void(0)". Using "#"
causes the browser to jump to the top of the page when the hyperlink is
clicked (default empty # anchor position). Using "javascript:void(0)"
will not change the browser's scroll position.
2015-09-12 13:35:48 -07:00
Ade 912d5c4d78 Fix history indent 2015-09-12 08:20:18 +12:00
Bas Stottelaar faa4bd82ae Add advanced option to stop renaming folders. Refs #2281. 2015-09-10 20:37:21 +02:00
Bas Stottelaar 409f6b8dd5 At least display that it is wrong. Refs #2306. 2015-09-10 20:26:31 +02:00
Bas Stottelaar 4e79698b4e Add undocumented feature. Refs #2317 2015-09-10 20:23:15 +02:00
Bas Stottelaar 07b28605b5 Add config option to disable changing file permissions (advanced feature for now). 2015-09-10 20:17:27 +02:00
Bas Stottelaar c4403cc4de Add logging to issue #2330. 2015-09-10 20:05:02 +02:00
Bas Stottelaar 7e0742f29b Potential fix for #2355. 2015-09-10 19:55:33 +02:00
Bas Stottelaar b21aef221e Add SSL/SNI diagnostics script. 2015-09-10 19:43:51 +02:00
Bas Stottelaar 20934f3ac8 PEP8 + ignore requests warning. 2015-09-10 19:42:25 +02:00
Bas Stottelaar 715e497789 Upgraded requests to git-master and forced urllib3 to git-master. Fixes strange errors with pyOpenSSL. See https://github.com/shazow/urllib3/issues/556. 2015-09-10 19:42:07 +02:00
rembo10 c0d389c283 Updated changelog with right diff urls 2015-09-05 16:07:51 -07:00
rembo10 6720575bd9 v0.5.9 2015-09-05 16:01:52 -07:00
rembo10 b1ec750d1d Updated changelog for v0.5.9 2015-09-05 16:00:55 -07:00
Ade d9c78da997 blackhole convert magnet
Seems only torcache working, comment others and add user agent
2015-09-05 11:42:35 +12:00
Ade 1fa26e763d kat flac 403 fix 2015-09-05 00:03:37 +12:00
Ade bb71b3d3d9 Strike provider 2015-09-04 21:09:22 +12:00
Ade 65e8e56e4a Show artist name rather than guid when deleting 2015-09-04 18:45:32 +12:00
Ade ee415d0e50 Fixes #2347 2015-09-04 18:32:15 +12:00
Ade 9db88a6c4f Removing nabz broken 2015-09-03 18:13:23 +12:00
rembo10 e5151a0a19 #2343 Added option to stop post processing if no good metadata match is found 2015-09-02 12:59:17 -07:00
rembo10 570234717a Changing the vip mirror to url to prepare for server upgrade 2015-09-02 12:11:25 -07:00
Ade 3f60d1f8de torznab config issues 2015-09-02 21:16:22 +12:00
AdeHub 65d100c814 Merge pull request #2338 from zone117x/develop
Implemented Jackett (Custom Torznab) option for Torrent Search Providers
2015-08-24 21:13:50 +12:00
unknown 61bdab8621 Implemented Jackett (Custom Torznab) option for Torrent Search Providers 2015-08-23 11:41:23 -06:00
Ade 8c94c9ecbf last.fm fix
failing if mbid not found
2015-08-21 19:23:56 +12:00
Ade 7fd895ecb5 Potential fix for #2316 2015-08-21 18:50:45 +12:00
Ade 213bc07646 Keep Original Folder fix 2015-08-07 17:43:22 +12:00
Ade 1f081c181c rutracker 2nd login
try logging in again after 10 secs if 1st attempt fails
2015-08-05 21:27:43 +12:00
Ade db1d31900e rutracker small fix up 2015-08-03 18:39:51 +12:00
Ade 2219c79ac3 potential kat fix 2015-08-02 13:52:41 +12:00
Ade d2782179aa rutracker revision
- Now uses requests with more logging
- Update to latest BeautifulSoup and html5lib libs
2015-08-02 12:18:25 +12:00
rembo10 d90a31afc7 Fix for #2282 2015-07-23 18:09:38 +01:00
rembo10 1c236fe0f3 Real fix for pushover 2015-07-23 11:25:06 +01:00
rembo10 24165fb5f3 v0.5.8 2015-07-13 15:22:03 -07:00
rembo10 71da960386 Updated changelog for v0.5.8 2015-07-13 15:21:44 -07:00
rembo10 a16c2d0a26 Fix for #2279: What.cd not honoring custom search string 2015-07-13 15:09:01 -07:00
rembo10 53de44a225 typo when excluding similar artist update on an artist scan 2015-07-08 23:15:38 -07:00
rembo10 e32cff60e5 Took out some unneccessary functions if we're just scanning an artist 2015-07-08 22:26:55 -07:00
rembo10 0ebba8d17c Fix for #2271: Scanning an empty directory with DETECT_BITRATE turned on 2015-07-08 21:58:41 -07:00
rembo10 464db79c04 Some cleanup to the scanArtist function 2015-07-08 11:52:00 -07:00
rembo10 65019d8323 Fix for #2260 & #2129 & 2175 & #2163 : Better artist directory scanning 2015-07-08 02:41:17 -07:00
rembo10 f131d316ca Set localhost as default 2015-07-08 00:45:33 -07:00
rembo10 e6663c96b5 Fixed some pushbullet config text 2015-07-07 23:56:17 -07:00
rembo10 5f06d11fe9 Fixed pushbullet notifications 2015-07-07 23:47:38 -07:00
rembo10 6db2836662 Moved plex notifications to requests lib for pre-v12 plex 2015-07-07 22:54:34 -07:00
rembo10 cb209f8d98 Fix for #2264: Metacritic parsing failing with htmlparser 2015-07-06 13:05:51 -07:00
rembo10 5634e17a2e Fix for #2155, local variable response referenced before assignment utorrent 2015-07-06 01:28:48 -07:00
rembo10 7c990edeaf Better fix for #2183 2015-07-06 00:34:16 -07:00
rembo10 9149f62760 Fix for #2173: Uncaught exception in get_age 2015-07-06 00:21:26 -07:00
rembo10 872ec6b11c Fix for #2089 2015-07-06 00:09:43 -07:00
rembo10 064a21a07c Better fix for #2183 2015-07-06 00:02:09 -07:00
rembo10 57c3c7b2e0 Fixed songkick description to prevent spilling over on default fonts 2015-07-05 21:44:37 -07:00
rembo10 6dc75d7a44 Cleaned up the config page a little bit. Took out {option} enabled buttons and just put them in with the option. Alphabetized the notifiers. Fixed checkbox on chrome 2015-07-05 21:40:52 -07:00
rembo10 5f3b7e05c5 Fixed some appearance stuff on the config page (if fonts weren't installed) 2015-07-05 15:04:18 -07:00
rembo10 61d3d8ad00 Fix for history page showing nzbs snatched from hp indexer as unknown 2015-07-05 12:05:04 -07:00
rembo10 e36440f834 Fix for XSS bug when searching 2015-07-04 23:53:03 -07:00
rembo10 4029543d51 Added option to wait until an album's release date before searching 2015-07-04 20:43:06 -07:00
rembo10 8aee9ac91f Fixed plex client url in config 2015-07-04 19:36:39 -07:00
rembo10 6e5e15f06f Fixed plex notifications for version 12 2015-07-04 19:27:27 -07:00
rembo10 a72bd4cb7c Fixed up the appearance of the config page (was kind of broken on Firefox) 2015-07-04 17:26:47 -07:00
rembo10 d062ab553c Merge branch 'master' of https://github.com/texke/headphones into develop 2015-07-04 12:26:05 -07:00
rembo10 a41edde12a Merge branch 'wfriesen-logtypo' into develop 2015-07-04 12:23:57 -07:00
rembo10 7608927b4f Merge branch 'logtypo' of https://github.com/wfriesen/headphones into wfriesen-logtypo 2015-07-04 12:23:29 -07:00
rembo10 24d7647c08 Updated notifymyandroid library 2015-07-04 12:13:40 -07:00
rembo10 a14369cb7d Added option to only include 'official' extras, rather than everything (bootlegs, promos, etc) 2015-07-04 00:47:02 -07:00
rembo10 3e81c4f3b6 Fix for #2183. Check to make sure the response has headers before trying to parse them 2015-07-03 21:01:46 -07:00
rembo10 84a6c19677 Release v0.5.7 2015-07-01 02:18:01 -07:00
rembo10 624a1d5509 Updated changelog for 0.5.7 release 2015-07-01 02:17:51 -07:00
rembo10 8b6d35cfe2 Updated changelog to reflect metacritic changes 2015-07-01 02:08:13 -07:00
rembo10 867e502448 Cache metacritic scores in the artists table so we don't lose them if we can't connect for whatever reason 2015-07-01 02:06:27 -07:00
rembo10 74275b969e Added a useragent to the metacritic request 2015-07-01 00:56:48 -07:00
William Friesen 275dde0630 Fixed typo in postprocessor message 2015-06-28 10:56:48 +10:00
Bas Stottelaar 46b470f30b Merge pull request #2253 from Hellowlol/patch-1
Add getLogs and clearLogs to api
2015-06-26 08:04:05 +02:00
Hellowlol fbfec95a8a Add getLogs and clearLogs to api 2015-06-25 22:53:39 +02:00
rembo10 1e75a18f55 Initial commit to add plex tokens. Plex notifications need to be updated to requests, and the get request to the server might need to be cleaned up - but want to make sure it works first 2015-06-19 17:08:54 -07:00
Jens Rogier a98849bf30 Added Musicbrainz link to "alternate release" window 2015-06-18 17:01:01 +02:00
rembo10 1b998e9d01 Updated pushover to use requests lib 2015-06-12 00:08:35 -07:00
rembo10 ebd6d3f3f9 Added option to keep folders when force post-processing under Manage. Also, added config option to keep original folder globally 2015-06-09 00:31:50 -07:00
rembo10 1204afadbb Convert preferred bitrate to vbr preset for what.cd searching 2015-06-08 21:56:10 -07:00
rembo10 cd08b72df7 Added ability to test pushover 2015-06-08 21:55:14 -07:00
rembo10 c5ad7c98e2 Release v0.5.6 2015-06-08 11:42:21 -07:00
rembo10 4b8222d792 Updated changelog 2015-06-08 11:37:51 -07:00
Ade a3524ef8aa OS X Notification fix 2015-06-02 09:02:29 +12:00
rembo10 49ab8aa67d Merge branch 'develop' of https://github.com/rembo10/headphones into develop 2015-05-22 20:26:05 -07:00
rembo10 fa85639efb Hide update bar if github checking is turned off 2015-05-22 20:25:40 -07:00
rembo10 84bca81a9a Update CHANGELOG.md 2015-05-22 20:23:17 -07:00
Ade 206ea72a27 mb demo 2015-05-23 08:59:56 +12:00
rembo10 cc2aceb3d8 Fix for nzbget connection url (#2135) 2015-05-21 19:14:58 -07:00
rembo10 00b95aa6c3 Merge branch 'master' of https://github.com/rembo10/headphones into develop 2015-05-21 18:37:15 -07:00
rembo10 a7632cc1e5 For series, use series name + year as search term 2015-05-21 18:36:58 -07:00
rembo10 39f07025c6 Removed a check from postprocessor normalizedAlbumArtist/artistTitleCount, fixed some logging 2015-05-20 10:26:04 -07:00
rembo10 658cb0403f Added support for series (initial stages - needs some cleanup) 2015-05-19 23:53:14 -07:00
rembo10 db1519bcea Updated musicbrainz library 2015-05-19 20:26:50 -07:00
rembo10 885d1cc77c Updated the codeshy.com links to point to https 2015-05-19 18:15:05 -07:00
rembo10 4005becd0a Updated changelog 2015-05-19 18:06:44 -07:00
rembo10 4c16b53c2a SSL for headphones indexer 2015-05-19 17:50:54 -07:00
rembo10 93dbf13d88 Few metacritic changes. Formatting on artist page, css & fixed replacements in artist name 2015-05-19 16:23:43 -07:00
Bas Stottelaar c5dd1a9002 Merge pull request #2223 from MattTavares/patch-1
Fixed for spelling "writable" in postprocessor.py
2015-05-19 10:12:20 +02:00
rembo10 18af7d6392 Updated changelog 2015-05-17 13:54:02 -07:00
rembo10 dbeb31d4fe Initial commit for fetching metacritic scores. Needs better presentation 2015-05-17 13:53:08 -07:00
rembo10 0fb9234ebc Updated changelog 2015-05-16 20:47:55 -07:00
rembo10 6e4cec829a Updated some sabnzbd logging 2015-05-16 20:40:49 -07:00
rembo10 5a433c42e7 Moved kickass search to json, updated some searcher log messages 2015-05-16 20:26:05 -07:00
rembo10 f808dd131b Fixed a couple log messages in sab.py to make it a little less redundant and fixed some log grammar in requests.py 2015-05-16 19:40:13 -07:00
rembo10 1bbf9a2318 Updated osx init script to prevent crashing on yosemite 2015-05-16 19:32:40 -07:00
rembo10 ccff70d9c4 Capitalized Headphones.py in osx init script 2015-05-15 20:58:09 -07:00
Ade 0347ca1bcc Various
- Email SSL
- History, show Folder Name when hovering over Status
- Cuesplit, allow wav, ape to be split
- mb, possible fix for #2181
2015-05-16 09:02:38 +12:00
Matthew Tavares 23564c14f9 Fixed for spelling "writable" 2015-05-14 10:24:00 -05:00
rembo10 93fca13510 Don't check for status when doing sabnzbd api call 2015-05-11 17:46:24 -07:00
rembo10 1a39066cfc Updated changelog to reflect the sab.py https fix 2015-05-06 00:04:35 -07:00
rembo10 70b1574aa6 Updated sab.py to use the requests library. Should fix #2208 2015-05-06 00:02:11 -07:00
rembo10 898f814dce Update CHANGELOG.md 2015-05-04 21:09:10 -07:00
rembo10 9d425d33ab Added button to toggle verbose/debug logging 2015-05-04 20:58:53 -07:00
rembo10 c6b0f58074 Moved the 'freeze db' option to advanced->misc. tab 2015-05-04 20:55:00 -07:00
rembo10 78b3802f8f Added option to ignore clean/censored releases (#2198) 2015-05-04 20:50:16 -07:00
rembo10 833b90ccff Release v0.5.5 2015-05-04 19:43:37 -07:00
rembo10 c27a381286 Update CHANGELOG.md 2015-05-04 19:37:23 -07:00
rembo10 ad29b43836 Needed to capitalize beets recommendation.none 2015-03-20 17:29:43 -07:00
rembo10 5cd9c51410 Move 'checking folder' message to debug level. Show it if forced 2015-03-15 18:28:38 -07:00
rembo10 6476d42371 Return some json when picking a specific download so we can close the dialog box on success/failure 2015-03-14 00:27:59 -07:00
rembo10 a48d9006ad Fix to get size sorting working again when choosing a specific download 2015-03-14 00:04:14 -07:00
rembo10 c5c2057859 Return everything if they're looking for a specific download 2015-03-13 23:43:29 -07:00
rembo10 1889ab4825 Fix for min/max sizes with target bitrate (wrong calculation) 2015-03-12 14:14:06 -07:00
rembo10 0c81560f2c uggh, indentation 2015-03-09 17:05:28 -07:00
rembo10 26005d6584 expose getArtistjson so we can automatically update albums when updating an artist 2015-03-09 17:03:25 -07:00
rembo10 b0b0bcbdb7 Fix for piratebay returning size as 0 bytes for all results 2015-03-06 10:02:04 -08:00
Bas Stottelaar 546099fa2d Updated Changelog.md 2015-02-19 20:15:08 +01:00
Bas Stottelaar c53fde6dca Merge remote-tracking branch 'origin/master' into develop
* origin/master:
  Release v0.5.4
  Added API call getSnatched
  Potential fix for #2055
2015-02-19 20:12:49 +01:00
Jonny c9aeefc67a Update postprocessor.py
Changed ID3 logging to debug
2015-02-19 19:24:35 +01:00
Jonny 37594d3384 Update postprocessor.py
Set-up of beets config to match headphones config of ID3 tag version before writing metadata
2015-02-19 19:24:25 +01:00
Jonny 00dc5d8c38 Update config.py
Added config option for ID3 tag version select
2015-02-19 19:24:18 +01:00
Jonny ff8f6b1d00 Update webserve.py
Added config option for ID3 tag version select
Conflicts:
	headphones/webserve.py
2015-02-19 19:24:09 +01:00
Jonny aa60ba1fb1 Update config.html
Added option to select using ID3v2.3
2015-02-19 19:22:42 +01:00
Bas Stottelaar 3b8341f249 Merge pull request #2125 from drzoidberg33/develop
Allow authentication on custom MusicBrainz servers
2015-02-19 14:06:29 +01:00
Tim a68bcb6ee1 Fix condition that checks if we should disable custom MusicBrainz server authentication. 2015-02-19 11:48:10 +02:00
Tim 24a52a294c Allow authentication on custom MusicBrainz servers using Basic HTTP Authentication. 2015-02-19 00:54:10 +02:00
Bas Stottelaar 03ea67b20b Fix for #2119 2015-02-15 14:02:49 +01:00
Ade 4f20003f9a Email part 2
small fix up
2015-02-06 21:37:41 +13:00
Ade a92d13652d Email notifications
#1045
2015-02-06 20:28:57 +13:00
Bas Stottelaar cf25fbc75d Release v0.5.4 2015-02-05 12:42:51 +01:00
Bas Stottelaar c1fb54ff1c Merge remote-tracking branch 'origin/master' into develop
* origin/master:
  Added API call getSnatched
  Potential fix for #2055
2015-02-05 12:40:54 +01:00
Bas Stottelaar bc484864ad Improved message + pep8 2015-02-05 12:40:24 +01:00
Bas Stottelaar 465ffaa5a7 Minor change for #2096 2015-01-28 00:57:28 +01:00
Bas Stottelaar 357c6bef0b Updated changelog 2015-01-27 23:14:32 +01:00
Bas Stottelaar d5de7f9b55 Limit dialog windows for 'choose specific downloads'. Fixes #2096 2015-01-27 23:13:53 +01:00
Bas Stottelaar 809beedcf8 Minor code adjustments 2015-01-27 22:52:14 +01:00
sarakha63 40071ffaf9 forgot the new config in headphones 2015-01-27 22:40:31 +01:00
sarakha63 501e3c1217 Minor correction for scan artist 2015-01-27 22:40:22 +01:00
sarakha63 ebeb8a13a4 added scna artist 2015-01-27 22:40:12 +01:00
Bas Stottelaar 8be598c533 Added enum backport 1.0.4 for beets 2015-01-27 22:31:49 +01:00
Bas Stottelaar cf6a6a876f Upgraded beets to 1.3.10, including patches 2015-01-27 22:26:35 +01:00
Bas Stottelaar ea842a95ca Upgraded mutagen to 1.27 2015-01-27 22:22:50 +01:00
Bas Stottelaar f6f1328721 Upgrade mako to 1.0.1 2015-01-27 22:06:05 +01:00
Bas Stottelaar 1e2901810f Upgraded PyTZ to 2014.10 2015-01-27 22:03:18 +01:00
Bas Stottelaar c5f67d070d Upgraded tzlocal to 1.1.2 2015-01-27 22:02:21 +01:00
Bas Stottelaar 527d2087c1 Upgraded unidecode to 0.04.17 2015-01-27 22:01:22 +01:00
Bas Stottelaar f6b5c0190d Upgraded requests to 2.5.1 2015-01-27 21:55:49 +01:00
Bas Stottelaar a5225dfc2e Hide songkick if there are no events AFTER filtering 2015-01-27 21:44:14 +01:00
Bas Stottelaar 7920f9ef2a Change file permissions according to file permission settings for artwork files. Fixes #2102 2015-01-27 21:32:14 +01:00
Ade 37d9cf11c3 Scheduling part 2
Remove job if interval changed to 0

Plus, fixup os x notify registering not working with yosemite and also
show album image in notification
2015-01-27 12:21:47 +13:00
Ade fdc5078a85 Re-schedule job if interval changed
If config saved without restarting and interval has changed, then
re-schedule job

Fixes #2099
2015-01-25 15:10:54 +13:00
Bas Stottelaar e4332642f4 Merge pull request #2093 from Burden50/patch-1
Added API call getSnatched
2015-01-19 01:19:18 +01:00
Robert Burden 2d74797e86 Added API call getSnatched
Added API call so you can get a list of what is currently being downloaded.
2015-01-18 01:19:22 -05:00
Bas Stottelaar 97ccb60326 Merge branch 'develop'
* develop:
  Release v0.5.3
  Active Artist Update can be launched via API
  Add more logging for issue #2058
  Minor code fixes
  Mark download as frozen if it should not be added
  Improve logging message.
  Add support for custom rename tags.
  Potential fix for #2055
2015-01-15 11:39:23 +01:00
Bas Stottelaar f9d331041d Release v0.5.3 2015-01-15 11:38:51 +01:00
Bas Stottelaar 4b76e156a9 Merge pull request #2075 from theguardian/ArtistUpdateAPI
Active Artist Update can be launched via API
2015-01-11 12:24:25 +01:00
Justin Evans 65660e57ca Active Artist Update can be launched via API 2015-01-10 14:14:24 -08:00
Bas Stottelaar 48e2722d9e Add more logging for issue #2058 2014-12-31 11:44:31 +01:00
Bas Stottelaar 91ec945a37 Minor code fixes 2014-12-28 19:59:20 +01:00
Bas Stottelaar ba62e297b5 Mark download as frozen if it should not be added 2014-12-28 16:13:20 +01:00
Bas Stottelaar 7f3d89aaa7 Improve logging message. 2014-12-28 14:55:35 +01:00
Bas Stottelaar b7321e3121 Add support for custom rename tags. 2014-12-28 14:55:08 +01:00
Bas Stottelaar 2ecf0bcb41 Potential fix for #2055 2014-12-28 13:36:45 +01:00
Bas Stottelaar fec92ea03e Potential fix for #2055 2014-12-28 13:36:03 +01:00
Bas Stottelaar 6a8ec5869b Release v0.5.2 2014-12-28 01:29:57 +01:00
Bas Stottelaar e7f585690d Merge branch 'master' into develop
* master:
  Log exact write check error to log (debug)
2014-12-28 01:29:21 +01:00
Bas Stottelaar a76064e46c Potential fix for bug mentioned in #2047 2014-12-20 11:39:13 +01:00
Bas Stottelaar db2407dd75 Updated CHANGELOG.md 2014-12-19 23:15:09 +01:00
NovaXeros d48a1bddde LMS Error reporting fix?
Attempt to fix false LMS error reporting.
2014-12-19 23:14:16 +01:00
Bas Stottelaar f83fc7fe4e Forgot piece of JS 2014-12-19 23:08:57 +01:00
Bas Stottelaar 3bd6f53788 Updated CHANGELOG.md 2014-12-19 23:05:35 +01:00
Bas Stottelaar 37638369c1 Show all search results when clicking 'Choose Specific Release'.
This effectively shows all results, even the ones without enough seeds and/or quality. However, they are marked.
2014-12-19 23:02:55 +01:00
Bas Stottelaar 39c5242f30 Add support for Old Pirate Bay.
Note that this only downloads magnet links and you have to provide the URL yourself, because OPB is meant to be 'open'.
2014-12-19 23:02:13 +01:00
Bas Stottelaar 5d69984ef9 Upgraded requests to 2.5.0 2014-12-19 21:09:54 +01:00
Bas Stottelaar 1f734d662e Fixed KAT URL 2014-12-19 21:08:24 +01:00
Bas Stottelaar ff3855a436 Updated changelog 2014-12-14 12:00:02 +01:00
Bas Stottelaar 30be69f08b Extended filtering directories to files. Only last part of path is matched.
Currently, only for library scan files, because the post processor code needs cleanups before filtering files would work.
2014-12-14 11:58:11 +01:00
Bas Stottelaar e1bd9eabe7 Add decorators for exposing. 2014-12-13 17:49:09 +01:00
Bas Stottelaar 997c78a08b Initialize logger to output to screen until it is known where to put the log files. 2014-12-13 17:30:54 +01:00
Bas Stottelaar e35d2277c3 Uniform exit codes. 2014-12-13 17:30:13 +01:00
Bas Stottelaar f29352b864 Reverse open browser and background thread start. 2014-12-13 17:29:30 +01:00
Bas Stottelaar 2ca60b09d4 Updated CONTRIBUTING.md 2014-12-13 17:28:52 +01:00
Bas Stottelaar 8ddf6ceb1f Make sure every scheduled job logs start and a stop 2014-12-13 15:09:11 +01:00
Ade aabcc86d9c cue split config paths for shntool, flac
Allow paths to shntool and flac commands to be specified in config.ini,
e.g.

cue_split_shntool_path = /usr/local/bin
cue_split_flac_path = /opt/local/bin
2014-12-13 20:02:44 +13:00
Ade ecae9d0996 Default artist latest album details
For manually added albums where the artist doesn’t exist, default
latest artist details from the added album
2014-12-07 16:04:06 +13:00
Ade 8eb0b02adb utorrent, hash is now upper case 2014-12-07 14:20:23 +13:00
Bas Stottelaar 33417d4b7d Prepare next release already. 2014-12-06 13:25:25 +01:00
Bas Stottelaar ce296e691b Add advanced option to ignore folder patterns (#2037).
Applies to post processing folders and library scan folders. There is no configuration option in the web interface (yet), but one can specify the following in the INI file (make sure Headphones is shut down!).

[Advances]
...
ignored_folders = *.git, *.btsync
...
2014-12-06 13:24:57 +01:00
Bas Stottelaar eb49d303ad Convert hash to upper. 2014-12-06 12:37:57 +01:00
Bas Stottelaar cf17287794 Merge pull request #2035 from Squirtukuk/2016
Fix heading and change restore to reset for clarification.
2014-12-03 11:09:45 +01:00
Simon 8be00cbee8 Fix heading and changed from restore to reset for clarification. Fixes issue #2016 2014-12-02 16:32:24 +00:00
Bas Stottelaar 592f4a8bac Merge pull request #2032 from jmullan/feature/cleanup
Fix some linting and other errors
2014-11-30 11:19:51 +01:00
Jesse Mullan 42cb1f784a Merge remote-tracking branch 'origin/develop' into feature/cleanup
* origin/develop:
  Log exact write check error to log (debug)
  Catch SSL errors which probably relate to self-signed certificates
2014-11-28 11:47:44 -08:00
Bas Stottelaar 38529e6809 Log exact write check error to log (debug) 2014-11-27 02:06:08 +01:00
Bas Stottelaar c1fe7df02d Catch SSL errors which probably relate to self-signed certificates 2014-11-27 02:05:45 +01:00
Bas Stottelaar 5c31f511f6 Log exact write check error to log (debug) 2014-11-27 01:50:32 +01:00
Jesse Mullan fc1c1ae31a Various lint stuff 2014-11-26 09:46:20 -08:00
Jesse Mullan ac0c61de98 Enable C0303 and C0325, whitespace at end of line and unnecessary () after if checks 2014-11-25 18:49:17 -08:00
Jesse Mullan fdb02cedea Various small cleanups 2014-11-25 14:37:26 -08:00
Jesse Mullan 68fa9beb22 Various cleanups 2014-11-25 14:36:41 -08:00
Bas Stottelaar 3075929824 Merge pull request #2022 from jmullan/feature/sleeps
Unify locking and sleeping mechanisms
2014-11-25 23:19:46 +01:00
Bas Stottelaar 754481ab13 Merge pull request #2020 from jmullan/feature/travis
Add mention of travis to contributing doc and fix some lint stuff
2014-11-25 23:19:35 +01:00
Bas Stottelaar 8bf2d81998 Merge pull request #2018 from sunmorgus/patch-1
Update pushbullet notification to use JSON
2014-11-25 23:17:36 +01:00
Jesse Mullan 80f795d32c Fix a typo 2014-11-23 23:55:01 -08:00
Jesse Mullan 9e6f2a4952 Fix using lock/rate limit for requests.* 2014-11-23 23:48:28 -08:00
Jesse Mullan 0146153d0a Hopefully fix pylint complaint, also lock pylint to pything 2.6 compatible version 2014-11-23 16:29:19 -08:00
Jesse Mullan 28079165c4 Fix pylint complaints about logging 2014-11-23 16:03:30 -08:00
Jesse Mullan 40884a7588 Unify locking and sleeping mechanisms 2014-11-23 15:55:56 -08:00
sunmorgus 9b990c03a6 Update pushbullet notification to use JSON
The pushbullet api has changed and now only accepts JSON encoded requests. I changed the content-type (line 454) to application/json, and encoded the data using json.dumps. Also, the url for api calls changed as well (line 453). 

Also removed the 'device_iden' (line 447), since it didn't seem to be working correctly. A note on this change...since we aren't specifying a device id in the request, pushbullet will ignore the selected device in the settings page and just send the notification out to every device the user has configured. May want to eventually update the settings page to get a list of devices from pushbullet and use the returned ids here.
2014-11-21 15:01:11 -05:00
Jesse Mullan a72bbf29f6 Added mention of travis-ci to contributing doc 2014-11-19 16:44:04 -08:00
Heisenberg74 7f740b1fc3 Update base.html
Remove class for log button because it looks ugly with it
2014-11-19 19:39:45 +01:00
Ade 8ae0e6d4d3 xld encoding
Use python method to read plist, should give a bit more logging
2014-11-19 22:48:23 +13:00
Bas Stottelaar f15ad447ca Merge branch 'develop'
* develop:
  Release v0.5.1
  Prepare for next release
  Fixed HTML div closing tag. Updated titles
  Fixed typo
  Allow one to disable all tasks
  Allow one to adjust interval settings without restarting.
  Prevent infinite recursion while scanning library.
  Fix for new paths
  Added the real pkg_resources from setuptools 7.0. Should fix #2001
  Fixed contrib scripts. Added *.pyc cleaning scripts
  Check if pyOpenSSL is installed before enabling HTTPS.
  Ignore CSR files
  Fixed SSL too long errors in CherryPy.
  Spaces removal
  Add downgrade functionality (contributed script)
  Use urlparse to parse transmission URL
  Fix for #1998
2014-11-13 20:00:27 +01:00
Bas Stottelaar 67c29560db Release v0.5.1 2014-11-13 19:59:53 +01:00
Bas Stottelaar 8e787dca86 Prepare for next release 2014-11-13 12:11:44 +01:00
Bas Stottelaar f06dd86a99 Fixed HTML div closing tag. Updated titles 2014-11-13 12:02:07 +01:00
Bas Stottelaar 73f3cc64a5 Fixed typo 2014-11-13 11:39:55 +01:00
Bas Stottelaar 2601de5c30 Allow one to disable all tasks 2014-11-13 02:58:41 +01:00
Bas Stottelaar ee3ccfa598 Allow one to adjust interval settings without restarting. 2014-11-13 02:32:48 +01:00
Bas Stottelaar 396cbb7b64 Prevent infinite recursion while scanning library. 2014-11-13 02:32:23 +01:00
Bas Stottelaar c64f08b2b5 Fix for new paths 2014-11-12 23:36:52 +01:00
Bas Stottelaar 3cf82f4dac Added the real pkg_resources from setuptools 7.0. Should fix #2001 2014-11-12 23:31:05 +01:00
Bas Stottelaar a43256e802 Fixed contrib scripts. Added *.pyc cleaning scripts 2014-11-12 23:22:41 +01:00
Bas Stottelaar 6f91694d51 Check if pyOpenSSL is installed before enabling HTTPS.
Previous, it is only checked if pyOpenSSL is installed when certificates are
generated. Now, it is checked when HTTPS is enabled. In case it is missing,
HTTPS will be disabled.
2014-11-12 22:53:22 +01:00
Bas Stottelaar d25ce692f9 Ignore CSR files 2014-11-12 22:34:51 +01:00
Bas Stottelaar f495fc01bc Fixed SSL too long errors in CherryPy.
The fix is suggested by https://bitbucket.org/cherrypy/cherrypy/issue/1298/ssl-not-working
2014-11-12 22:29:04 +01:00
Bas Stottelaar 4aacbd2731 Spaces removal 2014-11-12 22:21:20 +01:00
Bas Stottelaar bb7b1f64ce Add downgrade functionality (contributed script) 2014-11-12 20:25:08 +01:00
Bas Stottelaar 548e0a9821 Use urlparse to parse transmission URL 2014-11-12 18:49:57 +01:00
Bas Stottelaar af23e322a1 Merge pull request #1999 from Wiltons/develop
Fix for #1998
2014-11-12 18:21:33 +01:00
Wiltons b467e2db41 Fix for #1998
Moving "rpc" addition to transmission host string after exception
2014-11-11 23:29:38 +00:00
Bas Stottelaar 13f34a17b1 Merge remote-tracking branch 'rembo10/develop'
* rembo10/develop:
  Fixed link to installation wiki
  Improved the CHANGELOG, part 3
  Improved the CHANGELOG, part 2
  Improved the CHANGELOG
  Fix for #1994
2014-11-10 21:00:47 +01:00
Bas Stottelaar d0baeec53d Fixed link to installation wiki 2014-11-10 20:56:26 +01:00
Bas Stottelaar 6cb283cdf2 Improved the CHANGELOG, part 3 2014-11-10 20:49:30 +01:00
Bas Stottelaar 43f5fe421b Improved the CHANGELOG, part 2 2014-11-10 20:48:43 +01:00
Bas Stottelaar 09c041056e Improved the CHANGELOG 2014-11-10 20:48:06 +01:00
Bas Stottelaar fda4658e92 Fix for #1994 2014-11-10 20:47:27 +01:00
Pieter Janssens 9968bb2bb8 Merge pull request #1993 from rembo10/develop
Time for HP v0.5
2014-11-10 16:48:59 +01:00
Pieter Janssens e6397b28a5 Create CHANGELOG 2014-11-10 16:48:01 +01:00
Bas Stottelaar 61fa747813 Parsing RGID ID from folder is not second attempt in post processing steps, instead of third. See #1952 2014-11-10 13:26:18 +01:00
Bas Stottelaar a2ae89e5f9 Fix for logo 2014-11-10 12:53:45 +01:00
Bas Stottelaar 57f7bd1bd6 Updated README.md 2014-11-10 12:52:40 +01:00
Ade 47ed1e6a71 Searcher and torrent fixes
Should fix https://github.com/rembo10/headphones/issues/1990 and
https://github.com/rembo10/headphones/issues/1991
2014-11-08 08:33:45 +13:00
Ade 9d527e2fb2 Cuesplit fix up 2014-11-03 18:32:12 +13:00
Pieter Janssens 8e820cdad6 Merge pull request #1983 from jmullan/feature/travis-ci
Feature/travis ci
2014-11-02 14:07:04 +01:00
Jesse Mullan 0069bba318 Merge remote-tracking branch 'upstream/develop' into feature/travis-ci
* upstream/develop:
  Cue split config option

Conflicts:
	headphones/cuesplit.py
	headphones/postprocessor.py
	headphones/webserve.py
2014-11-01 20:46:52 -07:00
Jesse Mullan a67d0683ca Suppress a pylint error about something that we are handling 2014-11-01 19:49:24 -07:00
Ade 2b8c063c32 Cue split config option 2014-11-02 15:18:15 +13:00
Jesse Mullan 4ae3655025 Tell travis that we need pyopenssl 2014-11-01 19:10:29 -07:00
Jesse Mullan 29622ba221 Fix or suppress upgraded pylint errors 2014-11-01 18:25:00 -07:00
Jesse Mullan 45a7756828 Apparently there is no nosetests package in pip 2014-11-01 18:00:16 -07:00
Jesse Mullan 516c5fc84a Hopefully make pylint respect the pylintrc 2014-11-01 17:59:33 -07:00
Jesse Mullan 2ea34d4b97 Rearrange travis yaml file 2014-11-01 17:56:56 -07:00
Jesse Mullan 6952505368 Fix all pyflakes complaints 2014-11-01 17:50:30 -07:00
Jesse Mullan 60af816a66 Fix pyflakes complaints plus a pylint complaint 2014-11-01 17:03:11 -07:00
Jesse Mullan 364deea051 Fix pylint complaints 2014-11-01 17:02:56 -07:00
Jesse Mullan a300b62184 Loosen pep8 restrictions to not cover anything not fixed 2014-11-01 17:02:22 -07:00
Jesse Mullan 4e1716d58b Fix E712 comparison to True should be 'if cond is True:' or 'if cond:' 2014-11-01 16:33:35 -07:00
Jesse Mullan 7c98cbeb65 Fix E401 multiple imports on one line 2014-11-01 16:31:32 -07:00
Jesse Mullan 72852e04da Fix E721 do not compare types, use 'isinstance()' 2014-11-01 16:30:38 -07:00
Jesse Mullan 7726044c61 Fix whitespace around arithmetic operator 2014-11-01 16:28:44 -07:00
Jesse Mullan 76827abd78 Fix E701 multiple statements on one line (colon) 2014-11-01 16:27:02 -07:00
Jesse Mullan 561b6303bc Fix spaces after a semicolon 2014-11-01 16:26:16 -07:00
Jesse Mullan 4d85878921 Fix E703 statement ends with a semicolon 2014-11-01 16:24:42 -07:00
Jesse Mullan b7abdf1973 Fix E201,E202,E211,E241,E303 whitespace issues 2014-11-01 16:23:38 -07:00
Jesse Mullan 015d269667 Fix E711 comparison to None should be if cond is None: 2014-11-01 16:22:05 -07:00
Jesse Mullan 5ede29b401 Fix W601 .has_key() is deprecated 2014-11-01 16:20:43 -07:00
Jesse Mullan 4895d562b3 Ignore various pep8 comments rules 2014-11-01 16:19:55 -07:00
Jesse Mullan 5215e55848 Merge branch 'feature/autopep8' into feature/travis-ci
* feature/autopep8:
  Fix more config saving options
  autopep8 E272 whitespace before multiple spaces before keyword
  manual pep8 W291,W293,W391 blank lines, trailing whitespace
  autopep8 E221,E222,E225,E227,E228,E251 spaces around operators and in parameters
  autopep8 E301,E302,E303 too many / too few blank lines
  autopep8 E203 whitespace before colon
  autopep8 E231 whitespace after some punctuation
  autopep8 api.py
  autopep8 albumswitcher
  autopep8 headphones/albumart.py
  autopep8 headphones/__init__.py
  autopep8 Headphones.py
2014-11-01 16:16:58 -07:00
Jesse Mullan f8750645c2 Merge remote-tracking branch 'origin/develop' into feature/autopep8
* origin/develop:
  Fix more config saving options
2014-11-01 16:16:24 -07:00
AdeHub 9b6d75f370 Merge pull request #1982 from jmullan/feature/fix_more_config_saving
Fix more config saving options
2014-11-02 12:06:33 +13:00
Jesse Mullan c9f72d984e Add pep8 config file 2014-11-01 16:05:27 -07:00
Jesse Mullan 48022d92fe Set up basic travis ci testing 2014-11-01 16:00:53 -07:00
Jesse Mullan 1732205174 Merge remote-tracking branch 'origin/develop' into feature/autopep8
* origin/develop:
  Fix various config keys and template config keys to round trip more data
  Fix global of CURRENT_VERSION + other things that pylint points out
  Fix argument to turn SSL cert checking on and off

Conflicts:
	headphones/__init__.py
	headphones/webserve.py
2014-11-01 15:42:32 -07:00
Jesse Mullan 32e57ade15 Fix more config saving options 2014-11-01 15:29:57 -07:00
Bas Stottelaar b8cd8bd31b Merge pull request #1972 from jmullan/feature/fix_config_form
Fix various config keys and template config keys
2014-10-29 17:02:31 +01:00
Jesse Mullan b0c7c8b682 Fix various config keys and template config keys to round trip more data 2014-10-29 07:13:44 -07:00
AdeHub 4af96b2bb6 Merge pull request #1969 from jmullan/feature/fix_CURRENT_VERSION
Fix global of CURRENT_VERSION + other things that pylint points out
2014-10-29 07:37:52 +13:00
Jesse Mullan 8d7fd835a8 Fix global of CURRENT_VERSION + other things that pylint points out 2014-10-28 11:22:43 -07:00
AdeHub 56beb897cf Merge pull request #1965 from jmullan/feature/fix_ssl_check
Fix argument to turn SSL cert checking on and off
2014-10-28 07:11:36 +13:00
Jesse Mullan 3bcea4b692 autopep8 E272 whitespace before multiple spaces before keyword 2014-10-27 11:06:32 -07:00
Jesse Mullan 7369311501 manual pep8 W291,W293,W391 blank lines, trailing whitespace 2014-10-27 11:03:41 -07:00
Jesse Mullan 9eef7e40f5 autopep8 E221,E222,E225,E227,E228,E251 spaces around operators and in parameters 2014-10-27 11:00:48 -07:00
Jesse Mullan 5a4bff5be8 autopep8 E301,E302,E303 too many / too few blank lines 2014-10-27 10:56:43 -07:00
Jesse Mullan a040f38a3f autopep8 E203 whitespace before colon 2014-10-27 10:54:57 -07:00
Jesse Mullan 3ff09aeb46 autopep8 E231 whitespace after some punctuation 2014-10-27 10:53:47 -07:00
Jesse Mullan 045f1cd766 autopep8 api.py 2014-10-27 10:49:09 -07:00
Jesse Mullan c691b7c39d autopep8 albumswitcher 2014-10-27 10:48:15 -07:00
Jesse Mullan ed21bd4b3e autopep8 headphones/albumart.py 2014-10-27 10:47:36 -07:00
Jesse Mullan be7716326e autopep8 headphones/__init__.py 2014-10-27 10:47:05 -07:00
Jesse Mullan 8c21f781e1 autopep8 Headphones.py 2014-10-27 10:46:45 -07:00
Jesse Mullan 5c1223adfb Fix argument to turn SSL cert checking on and off 2014-10-27 10:16:43 -07:00
AdeHub 23055da02d Merge pull request #1955 from jmullan/feature/refactor_config
Reduce headphones module-level variables and reduce usage of globals, refactor processing of config from web form.
2014-10-27 18:48:04 +13:00
Ade 20981a6c61 Cue split part3 2014-10-27 17:30:22 +13:00
Jesse Mullan b082fbc0a5 Make sure that old config data is all written out 2014-10-26 09:09:12 -07:00
Jesse Mullan 2af45fd3fe Fix new variables 2014-10-26 08:49:09 -07:00
Ade 7d621cbc28 Cue split part 2 2014-10-26 19:00:09 +13:00
Jesse Mullan 48ef8a93a9 Merge remote-tracking branch 'upstream/develop' into feature/refactor_config
Conflicts:
	headphones/postprocessor.py
2014-10-25 19:14:14 -07:00
Jesse Mullan 80d0c6d430 Rename headphones.CFG to headphones CONFIG 2014-10-25 11:40:56 -07:00
Jesse Mullan ada8603e9f Fix extras form data; change bool cast to int(bool( cast for some data 2014-10-25 11:39:32 -07:00
Ade ce73883ba2 Auto cue split
- Attempt to split audio files by cue sheet during post processing,
requires shntools with flac or xld. If the split fails then the
directory is set as unprocessed.
https://github.com/rembo10/headphones/issues/1938

- last.fm album art/info - try with release id if adding album
manually. https://github.com/rembo10/headphones/issues/1923,
https://github.com/rembo10/headphones/issues/1871
2014-10-25 16:32:53 +13:00
Jesse Mullan bfbc2e3488 Merge remote-tracking branch 'upstream/develop' into feature/refactor_config 2014-10-23 11:59:04 -07:00
AdeHub ef493f65a0 Merge pull request #1959 from basilfx/symlinkScan
Follow symlinks for library scan.
2014-10-23 18:59:26 +13:00
Jesse Mullan d76fce8cbc Merge remote-tracking branch 'upstream/develop' into feature/refactor_config
Conflicts:
	headphones/__init__.py
	headphones/searcher.py
	headphones/webserve.py
2014-10-22 10:02:18 -07:00
Bas Stottelaar 87b444684a Follow symlinks for music folder scan. Fixes #1953 2014-10-22 11:35:00 +02:00
AdeHub f9dfdb2c98 Merge pull request #1958 from basilfx/improvements
Various improvements
2014-10-22 16:48:10 +13:00
Bas Stottelaar fd7bb4eb7e Add missing library for APScheduler. 2014-10-21 02:54:13 +02:00
Bas Stottelaar 2ddb96e134 Clarified post processing logging. 2014-10-21 02:43:50 +02:00
Bas Stottelaar 5ebe6bcd00 Display query/type in search box on results page. 2014-10-21 02:33:41 +02:00
Bas Stottelaar 6b4afd8877 Cleanup search code. Add support for magnet links conversion. Fixes #1926. 2014-10-21 02:07:56 +02:00
Bas Stottelaar 8a8821530a Jump back to top when changing pagination page. Fixes #1948 2014-10-21 00:22:53 +02:00
Bas Stottelaar bea7022b4c Upgrade autoreload setting 2014-10-20 21:48:17 +02:00
Bas Stottelaar 553cc536c0 Upgraded APScheduler to 3.0.1. This includes pytz and tzlocal as dependencies. 2014-10-20 21:48:10 +02:00
Jesse Mullan 8fbef76dc0 Merge remote-tracking branch 'upstream/develop' into feature/refactor_config 2014-10-20 00:13:02 -07:00
Jesse Mullan 2686b4c190 Remove superfluous values from configuration tuples 2014-10-20 00:12:56 -07:00
Jesse Mullan 43109f8172 Fix djmix to be dj-mix 2014-10-19 14:32:38 -07:00
AdeHub cf181e1d26 Merge pull request #1951 from andrenam/cherrypy360
Upgrade Cherrypy to version 3.6.0
2014-10-18 08:14:08 +13:00
andrenam 14c6f68fb7 - upgrade cherrypy to version 3.6.0
- dont't pass unicode hostname to cherrypy (see cherrypy-issue #1285,
https://bitbucket.org/cherrypy/cherrypy/issue/1285/n-must-be-a-native-str-got-unicode)
2014-10-14 02:43:55 +02:00
AdeHub 47f93d97d5 Merge pull request #1947 from basilfx/repocleanup
Updated the basic repository files. Structured API documentation, added ...
2014-10-11 10:53:35 +13:00
Jesse Mullan 0ffbd7824d Saving the config appears to work again 2014-10-09 10:51:03 -07:00
Bas Stottelaar 5ea6ec4328 Updated the basic repository files. Structured API documentation, added CONTRIBUTING.md 2014-10-08 20:57:43 +02:00
Ade 6b4fbe002d Search Results - Allow filtering by mb release id 2014-10-03 17:54:57 +13:00
Ade 7a078dc880 Manually adding release - update have
If the album has been scanned before adding the release it will be
unmatched, update to matched
https://github.com/rembo10/headphones/issues/1586
2014-10-02 15:51:20 +13:00
Ade 63e106a12d And another attempt to normalize 2014-10-01 22:13:02 +13:00
Ade 63a32e473f Autowant manually added albums config option 2014-09-27 15:31:33 +12:00
Ade e07fafda6e Don't auto search for manually added VA albums 2014-09-27 09:40:31 +12:00
AdeHub d887d06a4f Merge pull request #1919 from basilfx/fixes
Several fixes for some issues.
2014-09-26 07:15:11 +12:00
Bas Stottelaar 8d839ef3cf Fix unicode characters in Growl messages. Fixes #1695 2014-09-25 15:16:05 +02:00
Bas Stottelaar 353be0dbf5 Open file for writing instead of os.access. Fix for #1752 2014-09-25 14:31:47 +02:00
Bas Stottelaar 05ce5f7853 Latest Album -> Latest Release, fixes #1845 2014-09-25 14:13:33 +02:00
Bas Stottelaar f520ceaf25 Catch IOError. Fixes #1911 2014-09-25 14:11:57 +02:00
Bas Stottelaar 371401fa36 Updated requests library to 2.4.1. Should fix #1915 2014-09-25 14:08:27 +02:00
Ade 574a76c231 Normalize path replacement strings part 2
Potential fix for https://github.com/rembo10/headphones/issues/1824
2014-09-25 18:48:23 +12:00
Ade f6bb76acb0 Merge branch 'master' into develop 2014-09-23 17:53:53 +12:00
Ade 3f5044c82d OrderedDict fix 2014-09-23 17:44:56 +12:00
Ade 394876992b Lyrics mods
Switched to beets lyrics plugin
Fixes https://github.com/rembo10/headphones/issues/1896
2014-09-22 15:38:17 +12:00
AdeHub 365d4fa1bf Merge pull request #1907 from basilfx/ratelimit2
Increase Last.FM rate limit to 5 req/sec. Improved rate limiting
2014-09-22 11:39:23 +12:00
Bas Stottelaar 66309d806a Increase Last.FM rate limit to 5 req/sec. Improved rate limiting 2014-09-22 00:47:52 +02:00
AdeHub e7a97ed277 Merge pull request #1906 from basilfx/ratelimit
Initial version of rate limiting on requests
2014-09-22 10:16:26 +12:00
Bas Stottelaar c09c290ac8 Request should be in the lock 2014-09-21 18:44:02 +02:00
Bas Stottelaar efdd51c361 Don't load all Last.FM hits at once 2014-09-21 14:05:01 +02:00
Bas Stottelaar f6346f3c41 Save last request time after request itself. 2014-09-21 13:52:06 +02:00
Bas Stottelaar 2c72fb8e8e Initial version of rate limiting on requests. Should fix issue #1877 2014-09-21 13:42:11 +02:00
AdeHub 0c9de181f8 Merge pull request #1904 from basilfx/bugfixes8
Fixes for issues
2014-09-21 11:04:49 +12:00
Ade 757ebe9085 Merge branch 'master' into develop 2014-09-21 10:57:46 +12:00
Ade 61dc4fa95e KAT proxy fix 2014-09-21 10:56:27 +12:00
Bas Stottelaar c05fa78fa0 Fix for #1902 2014-09-21 00:55:35 +02:00
Bas Stottelaar 6a16fc2526 Fix for #1903 2014-09-21 00:52:59 +02:00
AdeHub e790443829 Merge pull request #1901 from rembo10/develop
Develop
2014-09-21 00:55:38 +12:00
AdeHub 9c1a0bc151 Merge pull request #1900 from basilfx/mpfix
OSError instead of IOError
2014-09-21 00:19:22 +12:00
Bas Stottelaar 1379ff7845 Oops, it should be an OSError instead of IOError 2014-09-20 13:18:14 +02:00
AdeHub 3a13612d15 Merge pull request #1899 from basilfx/mpfix
Multiprocessing IOError fixes
2014-09-20 23:12:21 +12:00
Bas Stottelaar 5305b6a3a8 Check for permission errors in queues and defer queue initialization until use. Fixes #1897. 2014-09-20 13:03:49 +02:00
Ade e9d9a6c441 misaligned else 2014-09-20 11:44:34 +12:00
Ade 8838ee481e Album searchresults CAA
tryCAA not working for me, added this.onerror=null instead to stop
looping
2014-09-20 11:41:03 +12:00
AdeHub 0fd4c9c998 Merge pull request #1892 from basilfx/libav
Add support for Libav-tools
2014-09-18 16:52:37 +12:00
Bas Stottelaar b857108db4 Add support for libav-tools 2014-09-18 02:13:17 +02:00
Bas Stottelaar 16ec910ba5 Initialize logging only for multiprocessing 2014-09-17 15:42:08 +02:00
Bas Stottelaar 5e98d96f65 Add proper support for logging in multiprocessing environment. Useful for multicore encoding. 2014-09-17 13:10:31 +02:00
AdeHub 7e2b9a30a2 Merge pull request #1890 from basilfx/freezedb
Add the option to freeze the database during post processing
2014-09-17 19:07:43 +12:00
AdeHub 4d683922c1 Merge pull request #1889 from basilfx/cleanup
Major cleanup of templates and code + delayed loading of album art
2014-09-17 19:07:16 +12:00
Bas Stottelaar 9d594988d9 Show artist ID, for debugging with multiple artist ids 2014-09-17 03:24:04 +02:00
Bas Stottelaar c441e888c2 Add option to freeze database during post processing 2014-09-17 03:16:43 +02:00
Bas Stottelaar 298daf9895 Don't forget the upcoming albums 2014-09-17 01:54:37 +02:00
Bas Stottelaar d04dff9130 Don't keep retrying CCA image 2014-09-17 01:51:03 +02:00
Bas Stottelaar 5eef5a594c Implemented unveil plugin. Load images only when shown on screen 2014-09-17 01:38:49 +02:00
Bas Stottelaar cce98709a7 Upgraded all JavaScript libraries. Moved UI parts from default interface to global. Fixed JavaScript Errors 2014-09-17 00:50:23 +02:00
Bas Stottelaar 3fef151fca Sorted all JavaScript, image and style files. Basically, it drops support for IE6/7 2014-09-16 22:43:20 +02:00
Bas Stottelaar a6fe517f87 Removed import lib.*/from lib.* 2014-09-16 22:06:41 +02:00
AdeHub 964c5008ca Merge pull request #1887 from basilfx/searchfix
Fixes for TPB and KAT search engine
2014-09-16 23:02:49 +12:00
Bas Stottelaar f250ae58a4 Fixes for search engines 2014-09-16 02:46:09 +02:00
AdeHub 7af194822c Merge pull request #1883 from basilfx/improvements2
Again, a set of improvements
2014-09-15 17:16:17 +12:00
AdeHub c4b1f3f4fe Merge pull request #1882 from basilfx/titles
Add titles to HTML tags in settings
2014-09-15 17:15:52 +12:00
Bas Stottelaar f4b13533ce Add support for Subsonic library update. Fixes #1864 2014-09-15 01:29:40 +02:00
Bas Stottelaar 638baf564d Convert old-style notifier classes to new-style classes 2014-09-15 00:54:30 +02:00
Bas Stottelaar 21b3d99249 Debug JSON responses 2014-09-15 00:40:32 +02:00
Bas Stottelaar d8dda5b24f First go on adding documentation to the title attribute. Not fully completed, but a first attempt. References #1803 2014-09-15 00:23:17 +02:00
Bas Stottelaar 25fb4361dc Code formatting. 2014-09-14 23:24:19 +02:00
Bas Stottelaar 8ec1808313 Another batch of improvements:
* Prefer 'with' statements for open
* Catch proper exceptions
* Remove ex() method, there was only one use and we catch thousands of exceptions.
2014-09-14 23:14:29 +02:00
Bas Stottelaar 43efca9d04 Code improvements. 2014-09-14 22:58:19 +02:00
Bas Stottelaar 34b9480a1b pyItunes is not used anymore. 2014-09-14 22:58:05 +02:00
Bas Stottelaar 51dfeb8190 myDB already available. Seems unneccesary to open another connection 2014-09-14 22:54:45 +02:00
Bas Stottelaar 3a03d940a1 Code improvements. Catch proper exceptions 2014-09-14 22:54:08 +02:00
Bas Stottelaar 69268b7d21 Proper line breaks for long lines 2014-09-14 22:41:07 +02:00
Bas Stottelaar e69cf3942e Increased logging for Last.FM requests 2014-09-14 22:36:30 +02:00
Bas Stottelaar 2e6c8e6537 Code improvements to the cache
* Catch the right exceptions where possible
* Move class vars to instance vars
* Prefer 'with' statement for files
2014-09-14 22:26:20 +02:00
Bas Stottelaar ca084f1216 It's more than that :-) 2014-09-14 22:18:35 +02:00
Bas Stottelaar a1bc3617a4 More logging + proper exception catching. 2014-09-14 14:54:39 +02:00
Ade a1e2042315 torrent more logging 2014-09-12 12:07:15 +12:00
Ade 3bb173c979 Piratebay user agent + More torrent removal stuff
- Piratebay user agent
- Torrent removal search interval config + more logging
2014-09-12 11:53:58 +12:00
Pieter Janssens 70135a5bf4 Merge pull request #1853 from basilfx/improvements
Improvements
2014-09-03 23:26:51 +02:00
Bas Stottelaar efa9ac77b8 Added link to GitHub and Troubleshooting in the footer, on the left side 2014-09-03 15:38:53 +02:00
Bas Stottelaar e8b330f3ba Strip message for debug logging. Truncated lines 2014-09-03 15:26:20 +02:00
Bas Stottelaar 56adf4a1ee Added log.info() for writing config to file 2014-09-03 15:18:49 +02:00
Bas Stottelaar 9f92b3b774 Improved Headphones.py 2014-09-03 14:54:30 +02:00
Bas Stottelaar 9d774b4486 Improved webstart.py
* Exit with code 1 on port in use
* Log when authentication is enabled
* Cleanup of code
2014-09-03 14:54:30 +02:00
Bas Stottelaar 163e1e3f2e Removed simplejson since that is Python 2.5 2014-09-03 14:54:30 +02:00
Ade adaaf51e9a Normalize path replacement strings
Potential fix for https://github.com/rembo10/headphones/issues/1824
2014-09-03 22:35:47 +12:00
Ade 2ba5978f84 Merge branch 'master' into develop 2014-09-02 19:42:15 +12:00
Ade 46240fb7d1 Add Demo to Extras
- fix up songkick location breaking artist page
- add description and link for songkick metro area filter
2014-08-30 22:17:30 +12:00
Ade a4fa8ca79d Reverted PP 2014-08-28 19:10:22 +12:00
Ade 701f709c23 Revert "Creating two functions from duplicated code"
This reverts commit 59b4cefd53.

Conflicts:
headphones/postprocessor.py

Reverting PP changes
2014-08-28 18:12:24 +12:00
AdeHub 3d22a66701 Merge pull request #1839 from rembo10/develop
Merge develop
2014-08-27 20:51:17 +12:00
Pieter Janssens a401ff4fb4 Merge pull request #1837 from multikatt/init_cleanup
Long list of calls -> for loop
2014-08-27 09:33:46 +02:00
Pieter Janssens 72419227e9 Merge pull request #1823 from multikatt/postproc_cleanup
Create two new functions, lowering amount of duplicated code
2014-08-27 09:33:02 +02:00
Ade 22bff59789 More Extras
- Artist Refresh, if removing extras from Modify/Fetch Extras then also
remove from db
- mb, use secondary type if type = Album and different, e.g DJ-mix
- utorrent - only check “Put new downloads in” directory
2014-08-27 18:59:31 +12:00
David b3746dc58e Long list of calls -> for loop 2014-08-26 20:20:21 +02:00
Ade b950bcbd0b Extras changes
- Append secondary type to type description if different, e.g. Album +
Mixtape/Street
- Keep Extras in order
- Fix bug where albums not deleted from db if not in mb results when
refreshing Artist
2014-08-25 18:46:09 +12:00
Ade aa6206a235 Remove from have when deleting Album 2014-08-23 09:08:48 +12:00
AdeHub 8cf23b79bf Merge pull request #1828 from multikatt/minor
Remove unused import
2014-08-19 22:17:50 +12:00
Ade bb884eeab7 Duplicate track issue
Possible fix for https://github.com/rembo10/headphones/issues/1504
2014-08-19 21:49:03 +12:00
David 72d2201dd6 Remove unused import 2014-08-18 21:17:28 +02:00
David 1b65df6c45 Return false on non existing dirs 2014-08-17 19:48:47 +02:00
Ade a7d1f128ad Create alltracks when adding album
Potential fix for https://github.com/rembo10/headphones/issues/1586
2014-08-17 18:14:18 +12:00
David 17ef29887e Use _file instead of file
since file is a built-in function
2014-08-16 01:57:05 +02:00
Ade 06822e2514 Ignore Artist fix
Fixes https://github.com/rembo10/headphones/issues/1660
2014-08-16 10:49:42 +12:00
Ade fc1c26f58f Sanitize name too
Fixes https://github.com/rembo10/headphones/issues/1706
2014-08-16 09:55:37 +12:00
David ef3cd00ef1 Removing duplications, replacing with functions 2014-08-15 19:12:02 +02:00
David 08f483d77d Removing duplications, replacing with functions 2014-08-15 18:57:44 +02:00
David 405ebe5ee2 Removing duplications, replacing with functions 2014-08-15 17:46:01 +02:00
David 59b4cefd53 Creating two functions from duplicated code 2014-08-15 17:02:34 +02:00
Ade d037147c23 Manage Unmatched fix
Potential fix for https://github.com/rembo10/headphones/issues/1808
2014-08-15 20:16:35 +12:00
Pieter Janssens 34097e2d81 Merge remote-tracking branch 'origin/develop' 2014-08-14 13:45:54 +02:00
Pieter Janssens e0f51f756c Merge pull request #1820 from basilfx/bugfixes7
Another set of small bug fixes and improvements
2014-08-14 09:19:21 +02:00
Bas Stottelaar 8c9b834bc4 Check for total number of tracks before continuing. Prevents ZeroDivisonError's 2014-08-13 18:31:08 +00:00
Bas Stottelaar 9178740c26 Added license info to requests.py 2014-08-13 18:24:17 +00:00
Bas Stottelaar 922cca9652 Constants should be in caps 2014-08-13 18:21:51 +00:00
Bas Stottelaar e2f0354deb Raised Last.FM timeout to 60 seconds 2014-08-13 18:20:29 +00:00
Ade 6891252cf6 utorrent fix up 2014-08-13 18:14:11 +12:00
Pieter Janssens c9debdcce5 Merge pull request #1812 from piejanssens/Begall-db-fixes
Begall's db fixes
2014-08-11 20:52:50 +02:00
piejanssens 6911dfde02 Merge branch 'develop' into Begall-db-fixes 2014-08-11 20:51:35 +02:00
piejanssens e7ddb2d7b2 Resolved conflicts for Begall's db fixes 2014-08-11 20:47:57 +02:00
Pieter Janssens 51fde7a52b Merge pull request #1811 from piejanssens/Begall-renamer-origfolder
Add $OriginalFolder flag to renamer (thx Begall)
2014-08-11 20:38:15 +02:00
piejanssens b36178d6d4 Add $OriginalFolder flag to renamer (thx Begall)
Add $OriginalFolder flag to renamer #1699
2014-08-11 20:37:09 +02:00
Pieter Janssens c19dffcb46 Merge pull request #1810 from piejanssens/develop
Add (re)search to wanted album on artist page
2014-08-11 20:24:07 +02:00
piejanssens e04245cff5 Add (re)search to wanted album on artist page
If the snatch got lost, you can click search instead of skip and then
search.

Replaces #1261
2014-08-11 20:23:00 +02:00
Pieter Janssens d5b08a8f51 Merge pull request #1809 from piejanssens/nzbget-priority
Add NZBget priority option (including force)
2014-08-11 20:12:39 +02:00
piejanssens 49179170fa Add NZBget priority option (including force)
This feature allows the user to select a priority for the nzb that is
sent to nzbget. Force will download the task even though the queue is
paused.
2014-08-11 20:09:19 +02:00
Ade e224ad1a6a Torrent seed ratio part 2
Set scheduled job to remove torrent when post processed and finished
seeding
2014-08-11 20:32:37 +12:00
Ade ba552bd1f8 Torrent seed ratio 2014-08-08 22:23:06 +12:00
Pieter Janssens ad1de823bd Merge pull request #1797 from Begall/nfo-orig
Add ability to rename .nfo file to .nfo-orig
2014-08-07 08:49:53 +02:00
Begall f2f8ad68a3 Merge branch 'develop' into nfo-orig 2014-08-06 23:19:26 +01:00
Begall 23e3dd91b3 Add ability to rename .nfo file to .nfo-orig 2014-08-06 22:53:41 +01:00
Pieter Janssens b4df21776e Merge pull request #1795 from rembo10/develop
Update README.md
2014-08-06 22:05:12 +02:00
Pieter Janssens 741538fa3c Update README.md 2014-08-06 22:04:49 +02:00
piejanssens 270d32b45e Merge remote-tracking branch 'origin/develop' 2014-08-06 21:44:36 +02:00
Pieter Janssens cedf54865d Merge pull request #1794 from multikatt/typo
small typo: ebedding -> embedding
2014-08-06 20:04:37 +02:00
piejanssens c0199cf356 Merge branch 'Fix-for-artist-name-in-album-title' into develop 2014-08-06 20:01:46 +02:00
piejanssens c95bb9d29c Check for album's with artist in title
Fixes #1788 and #1666
2014-08-06 19:59:59 +02:00
David 29ae400b80 small typo: ebedding -> embedding 2014-08-06 19:01:01 +02:00
Pieter Janssens 0cd4d540aa Merge pull request #1793 from multikatt/cleanup
Cleaning up redundant code and long lines
2014-08-06 17:57:40 +02:00
David 6ce710dbb1 Cleaning up redundant code and long lines 2014-08-06 17:50:17 +02:00
Pieter Janssens 90744c3b80 Merge pull request #1791 from multikatt/end-of-line
End of line convertion
2014-08-06 17:31:44 +02:00
Pieter Janssens d777cf74a5 Merge pull request #1792 from multikatt/gitignore
gitignore vims .swp files
2014-08-06 17:31:38 +02:00
David 9b1d6eb6e0 gitignore vims .swp files 2014-08-06 17:25:49 +02:00
David 676fa7199b Adding auto conversion to lf in gitattributes
To make end-of-lines consistent in the future.

Quoting http://git-scm.com/docs/gitattributes:
    When text is set to "auto", the path is marked for automatic
    end-of-line normalization. If Git decides that the content is text,
    its line endings are normalized to LF on checkin.
2014-08-06 17:02:08 +02:00
David fd30b3501e Converting crlf to just lf
Making end-of-lines consistent throughout the codebase.
2014-08-06 17:00:29 +02:00
Pieter Janssens 2a601d2731 Merge pull request #1784 from multikatt/1743
Replace Add with Search on top
2014-08-06 16:00:03 +02:00
David 296c9ca767 Reducing search bar width 2014-08-06 15:55:08 +02:00
Pieter Janssens 245f1fe366 Merge pull request #1787 from multikatt/cleanup
Creating method of shutdown actions
2014-08-06 14:04:27 +02:00
Pieter Janssens ce3b8b7894 Merge pull request #1789 from multikatt/drop_whitespace
Dropping trailing whitespaces
2014-08-06 13:28:51 +02:00
David 0c61eb11f5 Dropping trailing whitespaces 2014-08-06 12:46:26 +02:00
David 9ec4866cea renaming do_shutdown() -> do_state_change() 2014-08-06 12:10:03 +02:00
David d48dbc6bbb Creating method of shutdown actions 2014-08-06 00:59:03 +02:00
piejanssens 5cb9d78e35 Merge branch 'develop' 2014-08-05 23:05:32 +02:00
Pieter Janssens 78c866ce59 Update README with IRC instructions
We have an IRC channel now!
2014-08-05 21:36:25 +02:00
Pieter Janssens ab6fcc92e5 Merge pull request #1783 from multikatt/lyrics
Actually check if lyrics are found
2014-08-05 20:57:52 +02:00
Pieter Janssens ba640e2659 Merge pull request #1786 from piejanssens/develop
Added additional extra's for albums (e.g. dj-mix or mixtape/street).
2014-08-05 20:55:05 +02:00
piejanssens 9849a8334f Added additional extra's for albums (e.g. dj-mix or mixtape/street). 2014-08-05 20:51:48 +02:00
David ad645d960d Replace Add with Search on top 2014-08-05 18:28:34 +02:00
David 98604a2ab8 Make embedLyrics() actually check if lyrics found
Checking metalyrics, the variable, not lyrics the module
2014-08-05 17:10:48 +02:00
David bd8da45c1a Replacing redundant code with variable 2014-08-05 17:07:55 +02:00
Pieter Janssens b46787ae93 Merge pull request #1782 from multikatt/proxy
Creating set_proxy, which generates proxy urls
2014-08-05 14:14:54 +02:00
David 48b2b9235d Creating set_proxy, which generates proxy urls
Making it a function reduces the amount of repetition.
2014-08-05 13:57:02 +02:00
Pieter Janssens efd2e44ded Merge remote-tracking branch 'origin/develop' 2014-08-05 13:05:46 +02:00
Pieter Janssens 93e4e47cd6 Update gitignore (pycharm) 2014-08-05 13:04:33 +02:00
Pieter Janssens 9ec65c5f9a Fix KAT proxy slide in/out 2014-08-05 13:02:41 +02:00
Pieter Janssens 1597d028f0 Merge remote-tracking branch 'origin/develop' 2014-08-05 10:38:26 +02:00
Pieter Janssens 2178397c2f Fix KAT proxy variable declarations 2014-08-05 10:37:32 +02:00
Pieter Janssens 568f8327ef Merge remote-tracking branch 'origin/develop' 2014-08-05 10:13:19 +02:00
Pieter Janssens 7e2b7b7376 Fix syntax error nzbget.py 2014-08-05 10:11:31 +02:00
Pieter Janssens 253e578a98 Merge pull request #1780 from rembo10/develop
Add KAT proxy and fix nzbget URL
2014-08-05 09:59:01 +02:00
Pieter Janssens d590d037ad Fix indenting 2014-08-05 09:53:38 +02:00
Pieter Janssens 64298127c5 Dynamically construct nzbget URL
This allows config for no http prefix or with http/https prefix for the
nzbget URL.
2014-08-05 09:47:05 +02:00
Pieter Janssens 9122136594 Add optional KAT proxy config
Fixes #1778
2014-08-05 09:28:53 +02:00
Ade 1ee76f7488 mb tidy up 2014-08-03 13:14:47 +12:00
Ade 91bfdcd4bd Removed Isohunt, nzbsrus
+ mb fixups
2014-08-03 12:04:46 +12:00
Ade 2b02ae4196 Encoding fix
Fixes https://github.com/rembo10/headphones/issues/1754
2014-07-31 11:31:25 +12:00
Ade 326f866d7e Tweaks 2014-07-27 14:14:10 +12:00
Ade 86b1d6f443 imports not required 2014-07-27 01:16:02 +12:00
Ade 62e35e9a42 utorrent
- Attempt to ensure we have the correct folder for post processing
- Get rutracker working
2014-07-27 01:05:16 +12:00
Ade dc02fb4a06 Rename file fails if starts with '.'
Fixes https://github.com/rembo10/headphones/issues/1317
2014-07-18 20:45:56 +12:00
Ade c639d774cf Album Art Folder Naming fix 2014-07-18 19:35:40 +12:00
Ade 58bc146d11 KAT logging issue 2014-07-18 10:37:36 +12:00
Ade 429e2fcc40 Waffles failing 2014-07-18 08:37:24 +12:00
Ade 7d8140316c Merge branch 'develop' of https://github.com/rembo10/headphones into develop 2014-07-17 19:52:06 +12:00
Ade 3dfb8e0b0b Newznab - require all search term words in title
- Skip Newznab result if not all the search word terms are in the
result title

- removed old newzbin and no longer required usenet retention code
2014-07-17 19:45:09 +12:00
Pieter Janssens 9aeea8bcad Update README.md 2014-07-08 10:25:30 +02:00
Ade 850ce9ac3c Merge branch 'AdeHub-ade' into develop 2014-07-08 19:16:53 +12:00
Ade 61b901a481 Merge branch 'ade' of https://github.com/AdeHub/headphones into AdeHub-ade 2014-07-08 19:15:25 +12:00
Ade 08a2c2d148 Merge branch 'texke-master' into develop 2014-07-08 19:12:28 +12:00
Ade d87bb1f11c Merge branch 'master' of https://github.com/texke/headphones into texke-master 2014-07-08 19:11:54 +12:00
Ade bf4d642125 Merge branch 'basilfx-bugfixes6' into develop 2014-07-08 18:57:26 +12:00
Ade 7163886d31 Merge branch 'bugfixes6' of https://github.com/basilfx/headphones into basilfx-bugfixes6 2014-07-08 18:56:42 +12:00
Ade a3930e1c05 Merge branch 'sandersch-escape_html_entities' into develop 2014-07-08 18:23:17 +12:00
Ade 32a037b1c6 Merge branch 'escape_html_entities' of https://github.com/sandersch/headphones into sandersch-escape_html_entities 2014-07-08 18:15:52 +12:00
Ade c170b2a06d Merge branch 'develop' of https://github.com/rembo10/headphones into develop 2014-07-07 20:26:30 +12:00
Bas Stottelaar 0807c32a1c Check for message length 2014-07-05 14:51:54 +02:00
Bas Stottelaar c447212562 Forgot to remove parenthesis 2014-07-05 14:47:15 +02:00
Pieter Janssens 54bbde5c1d Merge pull request #1736 from piejanssens/patch-1
Update README.md
2014-07-04 21:57:47 +02:00
Pieter Janssens 7009984357 Update README.md
Removed out of date statements. Refer to wiki for installation notes and define rules on posting new issues.
2014-07-04 14:26:48 +02:00
Ade 7229b73862 fix merge conflict 2014-06-28 10:30:56 +12:00
Ade 66b9da36dd Album Search Results Changes
- mb findRelease
get additional info incl Date, Formats, Tracks, Rgid etc, pass to
searchresults
added optional artist to findrelease, if searching by album can now
enter album:artist in the search bar, went for this for now as I didn’t
want to change the design too much but maybe in the future we could
have 2 boxes, artist album and then there’s no need for the dropdown
artist, album

- base
position at search box and persist selected option (uses local storage)
when refreshing, useful if entering multiple albums
increased the search box size a little

- searchresults
album results - new fields from mb, fall back to cover art archive rgid
url if last.fm not found (should get more results), musicbrainz album
icon link, pass mb rgid to addReleaseById to redirect to album page
artist results - musicbrainz artist icon

- importer
addreleaseById - added rgid param to create the album record upfront
with status Loading if from searchresults

- webserve
redirect to album page using rgid from searchresults

- album
spinner while album is loading
2014-06-28 08:18:54 +12:00
Bas Stottelaar 9d9c5f53e7 Code improvements and fix for #1721 2014-06-22 17:50:16 +02:00
Bas Stottelaar 9a7300cda1 Parse response content for HTTP errors when verbose is turned on 2014-06-11 13:20:40 +02:00
Bas Stottelaar e618103f38 Merge remote-tracking branch 'rembo10/develop' into bugfixes6 2014-06-11 12:48:05 +02:00
rembo10 114b6b8a41 Fix for #1691, refresh artist failing for artists added from postprocessor 2014-06-08 09:52:27 -07:00
Bas Stottelaar 5064beffe9 Updated init scripts a little 2014-06-02 10:24:18 +02:00
Bas Stottelaar 19c4e7d7d3 Removed the unnecessary initLogger line 2014-06-02 10:22:37 +02:00
Charlie Sanders 8b799c7904 Use built in CGI module to escape special characters in title on history page 2014-05-26 01:28:05 -05:00
Jens Rogier a6c5894272 Totaltracks wasn't right when switching album release: the 2nd query didn't work (& was redundant?) 2014-05-20 21:39:23 +02:00
Ade 0fdc62c914 searcher filtering changes (please review)
- Filtering of Lossless min/max, Preferred bitrate % and already
downloaded check stops the searcher moving on to torrents if prefer NZB
set (and vice versa). Moved from sort_search_results to new routine

- Preferred bitrate low/high calc not quite right, should be target
size + high %

- Please correct me here but I think this logic ‘elif
headphones.PREFERRED_QUALITY’ is True if Preferred Bitrate
(PREFERRED_QUALITY = 2) which means it will always get lossy and
lossless. Surprised that no one has complained about this. Anyway, what
this means is that the ‘Allow lossless if no good lossy match found’
option kind of works although it shouldn’t! Changed to explicitly state
PREFERRED_QUALITY == 1 and added a flag to allow_lossless which is set
if Preferred Bitrate and High Limit and Allow Lossless are all set

- removed unused bitrate from rutracker
2014-05-17 11:30:18 +12:00
rembo10 88af84579c Merge branch 'develop' 2014-05-15 21:10:41 -07:00
rembo10 917dc7695f Fix for #1627: adding albums didn't add a ReleaseID to the database 2014-05-15 21:07:04 -07:00
rembo10 65e3e4faa2 Merge remote-tracking branch 'BenMagyar/master' into develop 2014-05-15 19:39:34 -07:00
rembo10 9e7ec3a65c Merge remote-tracking branch 'basilfx/bugfixes5' into develop 2014-05-15 19:36:40 -07:00
rembo10 7ac7b127c6 Merge remote-tracking branch 'AdeHub/ade' into develop 2014-05-15 19:35:26 -07:00
rembo10 3945753c5c Merge remote-tracking branch 'texke/master' into develop 2014-05-15 19:30:28 -07:00
rembo10 599585d57a Merge remote-tracking branch 'delphiactual/develop' into develop 2014-05-15 19:29:18 -07:00
BenM 10cf36401f Changed Add Artist and View MB 2014-05-13 21:11:31 -04:00
Bas Stottelaar fe2834f4a6 Be quiet when running daemon 2014-05-12 12:12:40 +02:00
Bas Stottelaar 674617c0f8 Ensure correct types 2014-05-12 12:09:26 +02:00
Bas Stottelaar f92f8928b0 Remove the validator, since it returns a dict on error and a list on results. Validator always expected a dict 2014-05-12 11:48:57 +02:00
Bas Stottelaar 45868bc523 Toggle VERBOSE at runtime. Just surf to /toggleVerbose. Comes in handy for the ones who don't want to change startup scripts 2014-05-12 11:45:28 +02:00
Bas Stottelaar 9b2594355f Let the --quiet option don't silence --verbose if we want verbose 2014-05-12 11:16:58 +02:00
Bas Stottelaar e30cb26200 Clarified meaning of HTTP error codes. Will show if it's local or remote error 2014-05-12 11:11:57 +02:00
Bas Stottelaar 63d3ab1cc1 Advanced option to turn off remote SSL certificate validation 2014-05-12 11:06:02 +02:00
Bas Stottelaar 188d907e10 GET, POST, HEAD etc are in lower case in requests.py 2014-05-12 11:02:25 +02:00
delphiactual e972a86233 Easier to follow logic for uTorrent 2014-05-11 21:26:58 -06:00
Ade 52a76e87ad Allow search provider names in preferred words
Adds to the priority if the word matches the search provider. The
provider priority is weighted based on position in list.
Preferred words in title take precedence over preferred providers.
Would be great if we could do something like sb, so until then…
2014-05-11 19:35:41 +12:00
Ade 8ab19f8121 remove rutracker track count check
should be able to filter out unwanted entries with Quality and Search
Word settings
2014-05-10 19:06:09 +12:00
Ade 6f3c8c68d4 Lossless min/max filter
filter results if calculated target size outside bitrate range
2014-05-10 18:53:58 +12:00
Ade 98385ff4c8 Transmission change for rutracker
use metainfo for local .torrent files (will only be rutracker)
2014-05-10 09:32:05 +12:00
delphiactual 62a6be26af PyNMA lib 2014-05-07 08:19:08 -06:00
delphiactual 5c1169ba9d Removed leftover DownloadStation [beta] changes 2014-05-06 21:38:28 -06:00
rembo10 0b47a5ca3a Merge remote-tracking branch 'delphiactual/develop' into develop 2014-05-06 19:51:20 -07:00
delphiactual 9da75a777b NMA fix 2014-05-06 20:22:13 -06:00
delphiactual 2fc2190b59 Merge pull request #2 from rembo10/develop
Develop
2014-05-06 19:48:09 -06:00
rembo10 e108935430 Fix for spinner not showing up anymore when marking albums as wanted 2014-05-06 17:01:30 -07:00
Jens Rogier bbde74db8d Fix: "Ignored" albums not ignored during scheduled updates. 2014-05-06 20:41:18 +02:00
rembo10 9fce4edf00 Fix for #1598, everything bring updated, even albums older than pause_delta 2014-05-06 11:21:37 -07:00
rembo10 ea3c6c3278 Changed VERBOSE back to 1 2014-05-06 11:06:31 -07:00
rembo10 6a0bd397cd Merge remote-tracking branch 'delphiactual/develop' into develop
Conflicts:
	headphones/utorrent.py
2014-05-06 11:05:54 -07:00
delphiactual 7bbb137fd9 uTorrent changes... 2014-05-06 02:12:17 -06:00
rembo10 e67d32445f Merge branch 'develop' 2014-05-05 23:49:47 -07:00
rembo10 83280f3f99 Fix for #1603, typo in utorrent 2014-05-05 23:43:32 -07:00
delphiactual 9c81fbaa2b Merge pull request #1 from rembo10/develop
Develop
2014-05-05 23:23:49 -06:00
rembo10 1d7415b91d Catch errors if we can't grab release info in post processor (#1602) 2014-05-05 18:56:47 -07:00
rembo10 bc5a042dcc Merge branch 'master' into develop 2014-05-05 17:46:25 -07:00
rembo10 e5af0bdd52 Merge branch 'develop' 2014-05-05 17:44:26 -07:00
rembo10 dc2939a4f9 Merge branch 'artist-page-refresh' into develop 2014-05-05 17:38:30 -07:00
rembo10 f52ec56a0f Couple fixes to get everything looking nice 2014-05-05 17:38:18 -07:00
rembo10 75b38df3d6 Typo 2014-05-05 16:58:31 -07:00
rembo10 0f5aeea345 some fixes 2014-05-05 16:58:31 -07:00
rembo10 d80fc36b29 Move to json so we can get the artist name as well 2014-05-05 16:58:31 -07:00
rembo10 4ca42c9c11 Initial changes to stop artist page from refreshing when artist is loading 2014-05-05 16:58:31 -07:00
rembo10 6c760902d6 Merge branch 'develop' 2014-05-05 16:49:58 -07:00
rembo10 2a0fcc7566 Fix for importer failing on adding new release groups 2014-05-05 16:49:43 -07:00
rembo10 b763ccdd08 Don't update all artist statuses when appending a single dir from the postprocessor. Also, don't change any other status but Skipped->Downloaded 2014-05-05 16:41:55 -07:00
rembo10 e72a0d1141 Merge pull request #1599 from delphiactual/master
Fix version check
2014-05-05 16:05:28 -07:00
rembo10 295e5a1ccf Merge branch 'develop': update Headphones Indexer url, fix for #1598, artist updates not working 2014-05-05 16:01:36 -07:00
rembo10 497fafb555 Don't need to query the db twice 2014-05-05 15:09:58 -07:00
rembo10 585f556006 Fix for #1598: Active artist update no longer updates any existing release groups 2014-05-05 14:26:44 -07:00
delphiactual 7b115126c9 Fix version check 2014-05-03 23:10:57 -06:00
rembo10 1a9165a084 Merge remote-tracking branch 'delphiactual/develop' into develop 2014-05-03 18:41:14 -07:00
rembo10 4a74d54cdc Merge remote-tracking branch 'tocsick/master' into develop 2014-05-03 18:40:11 -07:00
rembo10 a0755d4b1c Headphones indexer changes 2014-05-03 18:38:16 -07:00
delphiactual 084181a9a5 password field 2014-05-02 00:46:20 -06:00
delphiactual 5c381b9410 Added Labeling based off of hash for utorrent and fixed a typo in postprocessor.py 2014-05-01 21:58:05 -06:00
rembo10 0be9500518 Merge branch 'utorrent' into develop 2014-05-01 01:10:46 -07:00
rembo10 9c2da72dcc Bug fixes to get utorrent working 2014-05-01 01:09:26 -07:00
rembo10 3f6145cd07 Took out debug logging, put the torrent checking in the right place 2014-05-01 00:28:50 -07:00
rembo10 e155f19d0d Debug logging 2014-05-01 00:14:10 -07:00
rembo10 0c7ea8a5a0 typo 2014-05-01 00:09:45 -07:00
rembo10 1f3474a154 bug fix 2014-05-01 00:06:25 -07:00
rembo10 c0c1f9cc61 Some changes. Getting close 2014-05-01 00:02:29 -07:00
rembo10 e4382c23a3 fixin some bugs 2014-04-30 22:38:20 -07:00
rembo10 29b5305ab4 Slowly making progress 2014-04-30 21:58:46 -07:00
rembo10 758154e87e Some initial changes for utorrent 2014-04-30 21:00:30 -07:00
Kane Wallmann ea8b1815f6 Fixed tab indent to match file 2014-04-30 20:18:48 +10:00
Kane Wallmann ebc0b7205f Added MPC notifier, calls 'mpc update' on local machine 2014-04-30 19:53:59 +10:00
rembo10 06ee770184 Bug fix for postprocessor fix 2014-04-28 20:08:22 -07:00
rembo10 900325186b Url fix for pirate bay (credit to dsm1212) 2014-04-28 20:03:02 -07:00
rembo10 3b9816f3b3 Took out logging messages. Took out nzb possibilities from checkFolder since we're doing it in searcher.py anyways 2014-04-28 19:52:25 -07:00
rembo10 3e5779e5ce more log messages for testing #1575 issue 2014-04-28 19:22:28 -07:00
rembo10 66d0cb4a1b Added some more logging to see why postprocessor is not automatically running 2014-04-28 15:56:52 -07:00
rembo10 54c85c7951 Added some logging to see why postprocessor is not automatically running 2014-04-28 15:55:42 -07:00
rembo10 941da4be1c Merge remote-tracking branch 'sildur/master' into develop 2014-04-28 15:26:13 -07:00
rembo10 69c94baf18 Merge remote-tracking branch 'texke/master' into develop 2014-04-28 15:25:40 -07:00
Jens Rogier 90016f6eda Cleaned up query some more 2014-04-20 19:23:10 +02:00
Roberto Romero 06b647e30d Fix error: AttributeError: 'module' object has no attribute 'POST' 2014-04-19 01:41:23 -03:00
rembo10 84ebcb84f9 Changed 'newznab' -> 'custom newznab providers' to hopefully get rid of some confusion 2014-04-18 11:04:52 -07:00
Jens Rogier b11610face Fixed major mistake where tracklisting on the index would count the total tracks of the whole database when updating albums of the particular artist. 2014-04-18 10:40:15 +02:00
rembo10 6e90419014 Don't need to get commits behind if current version == latest version (versioncheck.py) 2014-04-17 20:44:28 -07:00
rembo10 0457c3c30e Merge branch 'develop': OSX & Boxcar notifications, bug fixes 2014-04-17 20:37:45 -07:00
rembo10 945cfbf21b Took out some leftover boxcar 1 stuff 2014-04-17 17:34:42 -07:00
rembo10 5769cb0dee Merge remote-tracking branch 'NovaXeros/patch-1' into develop
Conflicts:
	headphones/notifiers.py
2014-04-17 17:17:25 -07:00
rembo10 efd043e309 Merge remote-tracking branch 'texke/master' into develop 2014-04-17 17:15:35 -07:00
rembo10 fd19563160 Merge remote-tracking branch 'AdeHub/notify' into develop. Replaced boxcar notifications from daktak
Conflicts:
	headphones/__init__.py
	headphones/notifiers.py
	headphones/sab.py
	headphones/webserve.py
2014-04-17 17:14:37 -07:00
rembo10 1a2ed24566 Merge remote-tracking branch 'basilfx/bugfixes4' into develop 2014-04-17 16:57:19 -07:00
rembo10 d2fecc47ec Possible fix for #1560, what.cd choking when preferred bitrate is not one of the what.cd categories 2014-04-17 13:50:27 -07:00
Jens Rogier f9b0a5efb9 Fixed little bug where the trackcount on the index page was screwing up when choosing different release. 2014-04-17 19:41:40 +02:00
Jens Rogier e304e34ac7 Added ability to ignore albums.
Trackcount on homepage now is now excluding ignored albums.
Added "Manage ignored albums" to the Manage function.
2014-04-17 19:23:39 +02:00
Ade ff3826c0c8 More Boxcar2
Added MusicBrainz link to the message
2014-04-17 23:05:30 +12:00
NovaXeros c96b043a19 Update notifiers.py 2014-04-16 21:01:14 +01:00
NovaXeros a1d0f14eb8 Change LMS title in config options.
Squeezebox is an old unused name, and LMS isn't very self-explanitory.
2014-04-16 20:13:12 +01:00
NovaXeros 0234f4dab9 Update notifiers.py 2014-04-16 20:06:19 +01:00
NovaXeros e00411f7ad Cleaned LMS error reporting.
Even upon successful rescan, the code would throw a keyerror back. Not certain why, but LMS sends some really weird unicode JSON back as its result, unlike XBMC, so having response[0]['result'] will always throw back a keyerror.

Removing the key, however, and just asking the return to find 'result' works fine.
2014-04-16 20:04:14 +01:00
Ade 3b2350cd8f Boxcar2, OS X Notifications
- OS X Notifications require an application bundle, allow user to
create a dummy app in a specified location and then use bundle when
notifying
- Boxcar2
- Moved snatched notify logic to searcher so we can pass extra info
incl provider
2014-04-16 21:41:22 +12:00
Bas Stottelaar d490091a9a Bugfixes in helpers.py for MediaFile errors. Pre-detect potential file errors
Conflicts:
	headphones/postprocessor.py
2014-04-15 10:10:10 +02:00
Bas Stottelaar 5be36b517f Delete by ArtistID, not AlbumID 2014-04-15 10:00:33 +02:00
rembo10 dab323e8ff Better fix for album art stretching 2014-04-14 18:56:10 -07:00
rembo10 7e02f86af8 Fixed import for specifying beets config file 2014-04-14 18:51:24 -07:00
rembo10 26ed43fca8 Fix for album art stretching 2014-04-14 18:46:40 -07:00
rembo10 dab4e3d5f8 Updated beets lib to correctly point to config file (thanks to AdeHub) 2014-04-14 17:38:29 -07:00
rembo10 07e8b6b095 Merge remote-tracking branch 'texke/master' into develop 2014-04-14 17:33:33 -07:00
rembo10 52523a5d3c Merge remote-tracking branch 'daktak/master' into develop 2014-04-14 17:28:34 -07:00
rembo10 ded4b7ef6f Merge remote-tracking branch 'basilfx/bugfixes' into develop 2014-04-14 17:27:22 -07:00
Jens Rogier aa9d669a2b Fixed problem where albums with secondary types still got added 2014-04-14 21:28:06 +02:00
daktak 5378884bf8 boxcar notification 2014-04-14 17:43:01 +10:00
Bas Stottelaar 631d947a9a Re-added decoding of strings 2014-04-13 18:25:17 +02:00
rembo10 7280807588 Don't limit extras to 25 2014-04-12 17:44:48 -07:00
Bas Stottelaar ca010ac522 Prevent misleading messages about whitelisting 2014-04-12 20:35:15 +02:00
Bas Stottelaar e2e1ef9bc6 Add clear log option. Improved styling. 2014-04-12 20:27:38 +02:00
Bas Stottelaar a96b793c98 Add color for warnings.
Some distinction between the levels is handy.
2014-04-12 18:59:08 +02:00
Bas Stottelaar f7ba0ff634 All loggers on the same level.
In the issues, a lot of logs do not include DEBUG info, even if started with
verbose turned on. By defaulting all loggers to INFO, but DEBUG if verbose
is 2, I hope this will improve.

This will disable DEBUG for log file, but I assume verbose is turned on in
case of problems, so it will save disk writings.
2014-04-12 18:56:40 +02:00
Bas Stottelaar a0339d9814 Forgot a parenthesis 2014-04-12 18:23:59 +02:00
Bas Stottelaar eb7a1d7117 Updated methods to log messages new style 2014-04-12 18:23:59 +02:00
Bas Stottelaar 65fa0e21fa Do not decode for logger. 2014-04-12 18:23:59 +02:00
Bas Stottelaar 60ea86d499 Correct indent. Use signum is not None instead of type(signum) != type(None) 2014-04-12 18:23:59 +02:00
Bas Stottelaar 0411bb6b44 Importing with statement is for Python 2.5.
Bases on libraries (e.g. beautifulsoup4), I guess the minimal version for Headphones is at least 2.6
2014-04-12 18:23:58 +02:00
Bas Stottelaar d0198b15ee Restructured imports of post processor 2014-04-12 18:23:58 +02:00
rembo10 c4e8678d8f Fix for removeExtras error 2014-04-12 09:17:52 -07:00
rembo10 d6cd9cd7e4 whitespace 2014-04-11 11:30:51 -07:00
rembo10 6c4da76056 Merge branch 'develop' 2014-04-11 10:40:37 -07:00
rembo10 bf918e6e56 Merge branch 'bug-fixes' into develop 2014-04-11 10:40:00 -07:00
rembo10 0616aae684 Fix for magnet links not being opened on windows 2014-04-11 10:36:41 -07:00
rembo10 2d137ddcd6 Fix for newznab not being searched 2014-04-11 10:35:34 -07:00
rembo10 94a2be275b Merge remote-tracking branch 'basilfx/bugfixes3' into develop 2014-04-11 10:19:24 -07:00
Bas Stottelaar aba4bae39e Comparing against remote branch should be master...local_version, instead the other way around 2014-04-11 17:54:30 +02:00
rembo10 541fe5a610 Merge branch 'bug-fixes' into develop 2014-04-10 17:35:57 -07:00
rembo10 f7df469cc3 Merge branch 'bug-fixes' 2014-04-10 17:35:44 -07:00
rembo10 648fe27604 omgwtfnzbs fix 2014-04-10 17:35:30 -07:00
rembo10 a6532d149c Merge branch 'develop' 2014-04-10 09:56:11 -07:00
rembo10 966c097f76 Merge remote-tracking branch 'basilfx/bugfixes2' into develop 2014-04-10 09:53:50 -07:00
Bas Stottelaar d3d5b9dda2 Fix for transmission authorization problems 2014-04-10 14:12:03 +02:00
Bas Stottelaar a693777433 Add ordereddict (https://pypi.python.org/pypi/ordereddict) for Beets/Python 2.6 compatibility 2014-04-10 13:21:29 +02:00
rembo10 b406c3cb68 Return latest version from github rather than current version 2014-04-09 21:20:29 -07:00
rembo10 432354dcd1 Merge branch 'develop' 2014-04-09 21:12:36 -07:00
rembo10 496e9a0fd5 Fix for XBMC notification 2014-04-09 21:10:42 -07:00
rembo10 d3727d1fef Couple of fixes for the updater 2014-04-09 19:42:28 -07:00
rembo10 a37ce75038 Bug fix to return latest version available rather than None 2014-04-09 19:39:09 -07:00
rembo10 69d1807e9a Possible fix for updater 2014-04-09 19:33:07 -07:00
rembo10 0c32fbe706 'Nother bug in the updater 2014-04-09 18:56:33 -07:00
rembo10 a1ed6901d4 Possible fix for zip not updating 2014-04-09 18:52:31 -07:00
rembo10 1f4ca0ac48 Added yaml for windows 2014-04-09 18:32:08 -07:00
rembo10 ff16c84b8b Merge branch 'develop'. lots of changes, see git log for details. Cool features: post process single dirs, select specific downloads, track specific branches..... 2014-04-09 17:16:21 -07:00
rembo10 d1d45c21d4 Added ability to delete single history items 2014-04-08 20:17:57 -07:00
rembo10 9c14a2699e allow directories with non-ascii chars to be passed through as a single directory to force post process 2014-04-08 17:38:02 -07:00
rembo10 66becf2642 Skip to the next result if only magnet link: 2014-04-08 15:26:38 -07:00
rembo10 7240db2567 Took out automatic torrage links, now grab either the magnet or torrent file, depending on settings, also, allow headphones to open magnet links if the blackhole option is set 2014-04-08 15:14:38 -07:00
rembo10 6118fea823 Catch an exception if we can't compare versions on github 2014-04-08 15:13:35 -07:00
rembo10 49e0571cb9 added try/except block to adding album art to folder 2014-04-08 13:22:51 -07:00
rembo10 de78d1e737 Added a try/except to embedding album art 2014-04-08 13:15:57 -07:00
rembo10 93d4df29a6 More bugs in replace_illegal_chars 2014-04-08 12:52:14 -07:00
rembo10 ae7dc456ca Bug in helpers.replace_illegal_chars 2014-04-08 12:41:11 -07:00
rembo10 ea1e01d417 Merge remote-tracking branch 'NovaXeros/master' into develop
Conflicts:
	headphones/searcher.py
	headphones/webserve.py
2014-04-08 12:31:18 -07:00
rembo10 00c545b37e Make character replacement a bit more systematic & uniform throughout 2014-04-08 12:08:28 -07:00
rembo10 f51962f645 Added 'other' category to extras 2014-04-08 11:43:03 -07:00
rembo10 8e5b96059c Little bug fix to prevent opening up 'http://None' 2014-04-08 11:29:35 -07:00
NovaXeros aab4461ab6 Added a User-Agent to PirateBay searching. 2014-04-08 12:24:09 +01:00
NovaXeros 001404d5c4 Update webserve.py 2014-04-08 02:08:46 +01:00
NovaXeros 9416d185e7 Added LMS config options 2014-04-08 02:07:28 +01:00
NovaXeros a43df2b275 Add class and functions for updating an LMS server 2014-04-08 02:04:53 +01:00
NovaXeros 856bed9337 Add checks for LMS Enabled or not, and act upon it 2014-04-08 02:03:53 +01:00
NovaXeros 3a00c7a79a Add Logitech Media Server stuff 2014-04-08 02:02:50 +01:00
rembo10 fa202e3eb3 Don't update the tag cloud if we're doing the postprocessor library scan 2014-04-06 20:11:22 -07:00
rembo10 d6e3ebf41a Bug fixes, also moved lastfm.getSimilar to run only after a library scan 2014-04-06 18:35:17 -07:00
rembo10 81f9614595 Fixed typo 2014-04-06 18:31:51 -07:00
rembo10 a464856216 Little bug when searching waffles - requests merge 2014-04-06 17:34:11 -07:00
rembo10 150a49fb51 Little bug in getting commits behind introduced by requests merge 2014-04-06 17:15:26 -07:00
rembo10 8cdc48f33f Merge remote-tracking branch 'basilfx/requests' into develop 2014-04-06 17:08:54 -07:00
rembo10 0325660abe Merge remote-tracking branch 'basilfx/searchfix' into develop 2014-04-06 17:08:45 -07:00
rembo10 b52acfdcd0 Made log filter case insensitive 2014-04-06 16:45:28 -07:00
Bas Stottelaar d34455af3f Bugfixes 2014-04-07 01:30:41 +02:00
Bas Stottelaar 06f2f1c661 Prefer to log debug when it is not white listed 2014-04-07 00:57:50 +02:00
Bas Stottelaar 7c87c534f9 Restored logger functionality, since requests are seperated now 2014-04-07 00:34:07 +02:00
Bas Stottelaar 22151ff4b0 Moved all request methods to seperate file, since it is getting a core function 2014-04-07 00:32:43 +02:00
Bas Stottelaar a9a2fb78ed Moved search to the end to defer it more 2014-04-06 23:40:10 +02:00
Bas Stottelaar 21e1c100e7 Refactored Last.FM code 2014-04-06 23:30:04 +02:00
rembo10 8d267febcb Added double quotes to file replace list 2014-04-06 13:36:25 -07:00
rembo10 cd3cc7c811 Added a last catchall by assuming the folder name == album name (pretty common) 2014-04-06 13:14:11 -07:00
rembo10 686ea47449 Slightly improved re matching 2014-04-06 13:08:39 -07:00
Bas Stottelaar 41cb84957e Return empty list instead of None. It's not necessary to only subset the list if there are items 2014-04-06 18:03:37 +02:00
Bas Stottelaar 1de8ace080 Added six v1.6.1. Is required for some (newer) modules, like html5lib 2014-04-06 17:51:42 +02:00
Bas Stottelaar 7d3401ff9f Bugfixes 2014-04-06 17:50:50 +02:00
Bas Stottelaar a7d517fb09 Deffer searches until after all albums have been found 2014-04-06 16:42:02 +02:00
Bas Stottelaar 3dfedc305a Fix trailing spaces 2014-04-06 16:31:56 +02:00
Bas Stottelaar 210c23dd5d Refactored few names 2014-04-06 16:26:32 +02:00
Bas Stottelaar 9544b0e616 Replaced urllib2 in mb, notifiers, postprocessor, searcher and transmission 2014-04-06 16:16:04 +02:00
Bas Stottelaar 55796324b6 Replaces urllib2 in importer, lastfm and lyrics 2014-04-06 16:15:33 +02:00
Bas Stottelaar a717594950 Replaced urllib2 in albumart and cache 2014-04-06 16:15:11 +02:00
Bas Stottelaar 084bf59b6a Bugfixes 2014-04-06 16:14:51 +02:00
Bas Stottelaar 51c32e09bd Replaced urllib2 in version check 2014-04-06 14:03:16 +02:00
Bas Stottelaar cbb15a13dd Moved request method to helpers. Removed unused imports 2014-04-06 13:57:02 +02:00
Bas Stottelaar f757ce0bde Replaced urllib with requests, part 1 2014-04-06 12:18:51 +02:00
Bas Stottelaar 667f768749 Updated requests package to v2.2.1
It was included, but never used. However, lots of code can improve from this.
2014-04-06 11:32:14 +02:00
rembo10 ea6e3335a3 added in a pattern match for album folders in 'artist - album' format 2014-04-05 22:43:39 -07:00
rembo10 a59ed331a8 Merge branch 'process-singleton' into develop 2014-04-05 21:53:10 -07:00
rembo10 d3c48970ae Add option to manage->force actions to process a single directory, or specify a different parent folder to run force pp on 2014-04-05 21:52:51 -07:00
rembo10 65bd0ad229 Fixed a little bug in the postproesser if the folder started or ended with a eriod 2014-04-05 20:48:09 -07:00
rembo10 1580f5c22e Added a little text to the config file for OR words 2014-04-05 16:14:55 -07:00
rembo10 da05a44187 Added ability to use OR in required words 2014-04-05 16:10:46 -07:00
rembo10 0f619a2d43 Merge branch 'api-update-features' into develop 2014-04-05 09:34:21 -07:00
rembo10 769982cc43 Updated API to include the download_specific_release stuff 2014-04-05 09:33:44 -07:00
rembo10 30ba21c616 Merge branch 'select-download' into develop 2014-04-04 21:06:23 -07:00
rembo10 91b596fb0f Some bug fixes and styling changes 2014-04-04 21:06:07 -07:00
rembo10 d79dc8f1ab Most work done to get the ability to choose which release you want 2014-04-04 18:11:20 -07:00
rembo10 ed63a08333 Little bugfix to add REPLACE_EXISTING_FOLDERS to global vars in init.py 2014-04-04 14:17:01 -07:00
rembo10 e136a6a4e4 Deleted the outdated TODO, moved all init scripts into a folder 2014-04-04 14:09:28 -07:00
rembo10 b02889a451 Merge remote-tracking branch 'basilfx/discography_fixes' into develop
Conflicts:
	headphones/postprocessor.py
2014-04-04 14:06:00 -07:00
rembo10 1683e4da76 Merge remote-tracking branch 'basilfx/logfix' into develop 2014-04-04 14:00:33 -07:00
rembo10 d7bc0625e3 Merge remote-tracking branch 'basilfx/gitfix' into develop 2014-04-04 13:54:50 -07:00
rembo10 20863084da Merge remote-tracking branch 'basilfx/postprocess_fixes2' into develop 2014-04-04 13:52:00 -07:00
rembo10 75dc68f176 Merge remote-tracking branch 'basilfx/savefix' into develop 2014-04-04 13:47:18 -07:00
Bas Stottelaar 6ae655ad7a Fixed the album number detection. Added more debugging 2014-04-04 19:45:35 +02:00
Bas Stottelaar eb3a0ac217 Expand subdirectories so discographies are handled 2014-04-04 19:11:01 +02:00
Bas Stottelaar 42207516b9 Logfixes for postprocessor 2014-04-04 15:06:17 +02:00
Bas Stottelaar f90a87f943 Moved exception handlers to different methods
Improvements to exception logging
2014-04-04 15:06:15 +02:00
Bas Stottelaar a5480dd124 Encoder logging and exception improvements
Forgot to escape

Bugfix
2014-04-04 15:06:13 +02:00
Bas Stottelaar 1ac7ba0892 More logger replacements. 2014-04-04 15:06:13 +02:00
Bas Stottelaar e409859c35 Add excepthook for verbose. Bugfixes
Enabled exception hook for all cases
2014-04-04 15:06:11 +02:00
Bas Stottelaar 2add9fa264 First attempt to replace logger methods with lazy evaluating version
Forgot to format the message
2014-04-04 15:06:04 +02:00
Bas Stottelaar f3d192c548 Update GitHub version detection.
When working in a seperate branch, Headphones keeps telling I'm 0 commits behind. This patch looks at the
'behind_by' key instead of 'total_commit', which is what is desired. The case with -1 is now obsolete.

The web interface now respects the 'headphones.COMMITS_BEHIND' property.
2014-04-04 15:01:18 +02:00
Bas Stottelaar e4032106d6 Do not continue with other attempts after verify 2014-04-04 13:51:48 +02:00
Bas Stottelaar 300b47d6f8 Bugfix for not able to save if 'replacing existing folders' isnt checked 2014-04-04 13:00:32 +02:00
Bas Stottelaar 89aff6e199 Improve logging for Last.FM import 2014-04-04 12:08:57 +02:00
Bas Stottelaar bfbfb4262b Initial rewrite of logger.
Log messages are now fully handled by Python's logging framework. Since logger methods are
directly exposed, it is now possible to pass placeholders as arguments:

   logger.error("Caused by %s", object_with_expensive_to_string)

instead of

   logger.error("Caused by %s" % object_with_expensive_to_string)

This means debug messages are only formatted when they are enabled.
2014-04-04 12:08:56 +02:00
rembo10 79c293f32b Merge branch 'prefer-torrents-bugfixes' into develop 2014-04-03 22:37:52 -07:00
rembo10 a364c435e4 Fixed a bug with nzbs 2014-04-03 22:37:32 -07:00
rembo10 799aa5c26a Added option to replace existing folders instead of creating duplicates 2014-04-03 22:12:48 -07:00
rembo10 d7655ec95a Merge branch 'prefer-torrents' into develop 2014-04-03 19:45:24 -07:00
rembo10 7761015b15 Couple of bug fixes 2014-04-03 19:45:13 -07:00
rembo10 6279a95b6c Heavily modified searcher.py in order to allow searching for torrents over nzbs & combining results to pick the best of both 2014-04-03 19:29:12 -07:00
rembo10 1cff59fdaf Reverted a couple changes for bug testing 2014-04-03 15:29:53 -07:00
rembo10 864ea22a70 Pulled in a few beets updates 2014-04-03 15:29:53 -07:00
rembo10 acad25c534 Initial changes to get 'prefer torrents' option working 2014-04-03 15:29:53 -07:00
rembo10 269f346e1c Updated musicbrainz lib 2014-04-03 15:29:52 -07:00
rembo10 f03a2518ba Merge remote-tracking branch 'echel0n/forceprocess_dir' into develop 2014-04-03 15:29:39 -07:00
echel0n cc28e7b4c3 Added ability to forceProcess api to allow passing in of a directory 2014-04-02 19:30:09 -07:00
rembo10 41119b1d77 Fixed a couple of typos in the updater 2014-04-02 16:19:28 -07:00
rembo10 5da4cb7d12 Bug fixes for github-branch-switching feature 2014-04-02 16:14:02 -07:00
rembo10 933dbd205c Little fix to make sure zip/exe users don't get an error 2014-04-01 23:12:40 -07:00
rembo10 431e24ff37 Used old vip server address on accident 2014-04-01 23:00:09 -07:00
rembo10 d12b6cabc9 Updated musicbrainzngs lib 2014-04-01 22:41:13 -07:00
rembo10 8ccb7f2f16 Added override-float back in 2014-04-01 18:18:41 -07:00
rembo10 dd9c21fe3f Merge branch 'github-branch-switching' into develop 2014-04-01 13:57:16 -07:00
rembo10 a48babfa09 Easily track develop branch if.... on the develop branch 2014-04-01 13:56:45 -07:00
rembo10 e13cc15edf A little cleanup of the libs due to OCD 2014-04-01 11:01:11 -07:00
rembo10 073f1dad3f Merged in AdeHub/bugfix - fixed conflict with adding lib folder to path 2014-04-01 10:57:17 -07:00
rembo10 e721f3d302 Merge remote-tracking branch 'basilfx/growl' into develop 2014-04-01 10:46:41 -07:00
Bas Stottelaar b18487f512 Updated imports 2014-04-01 09:42:14 +02:00
Bas Stottelaar c1b0dc4225 Add lib/ folder to the PYTHON_PATH.
This way, modules inside the lib/ folder don't have to be repackaged, and allows top level folders (e.g. bs4) to move to the lib/ folder.

Approach is similar to what CouchPotato does.
2014-04-01 09:42:01 +02:00
Bas Stottelaar 31ed56bcc9 Merge with rembo10/develop 2014-04-01 09:41:48 +02:00
rembo10 0c714a78de Updated mako lib 2014-03-31 21:50:41 -07:00
rembo10 708f5fcd70 Minor library change for beets import for basilfx/postprocess_improvements 2014-03-31 16:59:03 -07:00
rembo10 feb86435d8 Merge remote-tracking branch 'basilfx/postprocess_improvements' into develop 2014-03-31 16:58:20 -07:00
rembo10 11b5c9ced1 Merge conflict from basilfx/multicore merge 2014-03-31 16:57:48 -07:00
rembo10 ad1c4851b1 Merge remote-tracking branch 'gotson/pushover-override' into develop 2014-03-31 16:53:41 -07:00
rembo10 5a1a6d1b57 Merge remote-tracking branch 'gotson/artist-sort' into develop 2014-03-31 16:53:21 -07:00
rembo10 341e2c5edb Added wma & asf to filetypes 2014-03-31 16:51:27 -07:00
rembo10 4f5a2cd3d0 headphonify beets 2014-03-31 16:25:49 -07:00
rembo10 2ba476c6ef Updated beets lib ( + mutagen ) and added unidecode 2014-03-31 16:21:50 -07:00
Bas Stottelaar 9872e9a1a3 Update WebUI to enable/disable Growl notifications 2014-04-01 00:36:02 +02:00
Bas Stottelaar c26e867859 Added initial version of Growl notification, including image 2014-04-01 00:35:40 +02:00
Bas Stottelaar 4607c2f28b Add GNTP library version 1.0.2 2014-03-31 23:30:35 +02:00
Bas Stottelaar 17f1bc5344 Restructured post processor resolving order.
Do not skip release group ID from filename if name/meta data failed.
2014-03-31 23:01:38 +02:00
Bas Stottelaar 7bb7cf9551 Extract media tags for determining album. 2014-03-31 22:30:22 +02:00
Bas Stottelaar b51a2eb4e3 Added switches in WebUI to enable/disable multi-core 2014-03-31 21:14:50 +02:00
Bas Stottelaar 1c3132b3aa Initial multi core encoding support 2014-03-31 20:42:50 +02:00
gotson 88a2d364f6 Pushbutton API token override 2014-03-31 17:46:18 +08:00
gotson 3dc515507c Save datatable sort for Artist view 2014-03-31 15:44:30 +08:00
Ade a1fe8f2519 nzbget - log as info instead of error 2014-03-31 19:23:08 +13:00
rembo10 f0b4f2f3c8 Merge remote-tracking branch 'gotson/songkick-https' into develop 2014-03-30 21:54:01 -07:00
rembo10 d2e2008f1b Merge remote-tracking branch 'cohena/develop' into develop 2014-03-30 21:51:38 -07:00
rembo10 2f10b9bbe8 Merge remote-tracking branch 'doucheymcdoucherson/patch-1' into develop 2014-03-30 21:51:13 -07:00
gotson d0ae36ac56 Request Songkick data over HTTPS, to avoid conflicts when Headphones is running over HTTPS or behind a HTTPS reverse-proxy 2014-03-31 12:51:00 +08:00
cohena 729a105377 Adding 'keeplogged' argument to maintain what.cd api login 2014-03-30 18:05:04 -07:00
doucheymcdoucherson 0bdc707fdf Change pushover notification title
Makes more sense to set pushover notification titles as "Headphones" rather than "Download and Postprocessing completed" - which may be too long (gets truncated on android app depending on screen resolution) and not descriptive when you have lots of other notifications coming in. If that verbiage is desired, it would be better in the "pushmessage" body. 

This may apply to the other notification types as well, but not sure as I don't use them.
2014-03-30 15:07:06 -07:00
cohena ca8ab32eaf Handle login expiration 2014-03-30 13:07:38 -07:00
Ade 6e2338184e Small bug fixes
- Delete from Releases when deleting artist/album
- Searcher - Size limits not quite working
- Searcher - 1st newznab used even if disabled
- Rutracker search stopped working for me, fixed by updating Beautiful
Soup. Moved bs4 and html5lib to lib and ensured (I think) it’s imported
from the right place
2014-03-30 16:32:48 +13:00
rembo10 dbe644aee2 Possible fix for album art permissions not being updated 2014-03-28 18:26:19 -07:00
rembo10 e293302bfe Catch an exception where lyrics can't be saved due to encoding error 2014-03-28 11:42:14 -07:00
rembo10 7c068ca4c5 Updated the 'maintaining db' log message 2014-03-28 11:25:17 -07:00
rembo10 537126b3d9 Enable songkick by default because it's awesome 2014-03-28 11:17:29 -07:00
rembo10 23c9750cc2 Merge branch 'develop' 2014-03-28 11:16:35 -07:00
rembo10 e69e391a33 Minor fix to handle empty songkick location on artist.html 2014-03-28 11:16:17 -07:00
rembo10 84aa80c93e Couple fixes for the songkick pull request from gitson 2014-03-28 11:12:59 -07:00
rembo10 aa4bb6b598 Readded songkick api from maiis 2014-03-28 10:41:29 -07:00
rembo10 00830ef3a2 Merge remote-tracking branch 'gotson/bugfix' into develop 2014-03-28 10:36:11 -07:00
rembo10 1d949badae Fixed merge conflicts from gotson songkick pull request 2014-03-28 10:35:02 -07:00
rembo10 df9432163e Reverted commit 2e64968 which added a new post processing dir 2014-03-28 10:16:41 -07:00
gotson dc07138caf Small bugfix on error:
TypeError: cannot concatenate 'str' and 'int' objects
2014-03-28 18:09:23 +08:00
gotson 96bc2b835c Songkick is now optional 2014-03-28 18:06:32 +08:00
gotson 44acaf7599 Songkick API key now properly stored in config.ini (and empty by default)
Added possibility to filter Songkick results per location (so far using a metro-area id)
2014-03-28 17:37:19 +08:00
rembo10 863ad41f7c Limit concert display to next 5 only 2014-03-27 20:25:34 -07:00
rembo10 fb4558e431 Brought back 'The' in front of artist names in the index 2014-03-27 20:13:39 -07:00
rembo10 6e18ceaaaa Merge branch 'develop' 2014-03-27 19:48:21 -07:00
rembo10 fc1fb9bc90 Merge remote-tracking branch 'AdeHub/bugfix7' into develop 2014-03-27 19:28:29 -07:00
rembo10 c322e96dff Merge remote-tracking branch 'jerbob92/master' into develop 2014-03-27 19:27:44 -07:00
rembo10 3166d3333c Merge conflicts 2014-03-27 19:26:49 -07:00
rembo10 1e683f9aa9 Merge remote-tracking branch 'opcon/pushbullet_api' into develop 2014-03-27 19:23:30 -07:00
rembo10 eb7d4638d1 Merge remote-tracking branch 'CameronNemo/master' into develop 2014-03-27 19:22:36 -07:00
rembo10 0fc242451a Merge remote-tracking branch 'maiis/master' into develop 2014-03-27 19:20:21 -07:00
Ade 40fe0cde15 Stop album being deleted and re-inserted as wanted on refresh if status set 2014-03-22 21:04:32 +13:00
Jeroen Bobbeldijk 6d60365ea3 Fixes #903 2014-03-18 09:21:41 +01:00
rxsegrxup b7ceae8a29 bugfix
Since we wont infinitely wait for the torrent folder to be created. Log an error if it can't be determined.
2014-03-11 12:56:09 -04:00
rxsegrxup 09648804f7 Do not search for albums missing information 2014-03-11 12:46:54 -04:00
rxsegrxup 8a0f7ba927 Fix infinite sleep, duplicate torrent fix
If a duplicate torrent is added return proper information.
When retrieving the folder name only try 10 times
2014-03-11 12:39:11 -04:00
rxsegrxup 58bc5947cd Allow for albums with no AlbumTitle or ArtistName
If an album is in the db with incomplete information allow the page to be accessible so it can be deleted.
2014-03-11 12:30:35 -04:00
Patrick Yates 8ed040a24e More descriptive api key label 2014-03-08 18:55:58 +11:00
Cameron Norman 6518e61963 Update init.upstart 2014-03-07 17:26:09 -08:00
Cameron Norman fbae7c3d30 Update init.upstart 2014-03-07 17:01:19 -08:00
Cameron Norman cb8c859802 Create init.upstart
Created an Upstart job.
2014-03-07 16:47:18 -08:00
Patrick Yates 6f7f472478 Added PushBullet notification support 2014-03-08 10:50:52 +11:00
Emmanuel Vuigner 81e13e5f68 remove console warning 2014-03-01 01:10:47 +00:00
Emmanuel Vuigner 1027009c15 remove conflict file 2014-03-01 00:44:55 +00:00
rembo10 fb80889d8e Added a Notifications tab 2014-02-27 18:33:38 -08:00
rembo10 e28f92b4cd Merge remote-tracking branch 'is33/patch-1' into develop 2014-02-27 18:25:43 -08:00
rembo10 c113d8f9aa Fixed some merge conflicts with the songkick merge from maiis 2014-02-27 18:24:47 -08:00
rembo10 680ec0ef27 Merge remote-tracking branch 'daktak/search-user-agent' into develop 2014-02-27 18:21:53 -08:00
rembo10 e0425f83a2 Merge remote-tracking branch 'pastudan/master' into develop 2014-02-27 18:20:49 -08:00
rembo10 b3be038c10 Merge remote-tracking branch 'CEbbesen/patch-1' into develop 2014-02-27 18:18:40 -08:00
rembo10 ec5d9f2554 Merge remote-tracking branch 'evanjd/master' into develop 2014-02-27 18:17:51 -08:00
rembo10 2e64968502 Fixed merged conflicts with postprocessing merge from echel0n, fixed some tabs->whitespace, fixed screwed up merge conflict resolution from pushalot merge 2014-02-27 18:16:20 -08:00
rembo10 b8f3a81512 Merge conflicts with pushalot merge 2014-02-27 18:11:03 -08:00
rembo10 1ff1e1fe0b Fixed some merge conflicts i webserve.py from the echel0n plex merge 2014-02-27 18:07:31 -08:00
rembo10 a245eeba5b Merge remote-tracking branch 'shanlar/init' into develop 2014-02-27 18:02:48 -08:00
rembo10 f5eaffa427 Merge remote-tracking branch 'echel0n/disable_download_scan' into develop 2014-02-27 18:01:47 -08:00
rembo10 10960a0aed Merge remote-tracking branch 'theguardian/twitter' into develop 2014-02-27 18:00:14 -08:00
is33 1b403750f9 Update searcher.py
Fix for KAT
2014-02-27 13:55:05 -05:00
Emmanuel Vuigner 5c6ec3984c change songkick API Key 2014-02-15 01:59:45 +00:00
Dan Pastusek 635c23dfc9 convert all icons to font-awesome vector based / retina compatible icons
Conflicts:
	data/interfaces/default/artist.html
2014-02-15 01:54:55 +00:00
Emmanuel Vuigner 424c53f6fb add songkick upcoming concerts on ArtistPage 2014-02-13 22:44:36 +00:00
daktak 69e9a329a5 user User_Agent from common 2014-02-07 12:10:00 +11:00
Dan Pastusek 8c4a93239b adding retina logo and favicon, adding retina search icon 2014-01-28 01:10:46 -07:00
Dan Pastusek 1c9f323e7e convert all icons to font-awesome vector based / retina compatible icons 2014-01-28 00:10:41 -07:00
Christian Ebbesen 2bf8bd18c7 Fixed URL for The Pirate Bay 2014-01-27 08:05:56 +01:00
Evan Bruhn afe9a0259e Fixes what.cd snatches getting stuck at pre-processing with blackhole downloader
Cloudflare requires a user-agent header otherwise will return 403
forbidden.
2014-01-27 14:05:09 +11:00
evanjd 03d577eb72 Fix for issues with what.cd authentication 2014-01-26 22:03:17 +11:00
Justin Tabish d4a5afea8b Added ability to set a seperate post-processing folder 2014-01-21 15:01:41 -08:00
Justin Tabish 5db9002bc4 Pushalot Service Added 2014-01-21 08:46:57 -08:00
Justin Tabish ec0fd92b80 Added Plex Media Server and Client Update Library and Notification functions. 2014-01-21 04:40:45 -08:00
Chase Bolt a7f34d8c90 adding status option for init.ubuntu 2014-01-19 20:07:38 -08:00
Justin Tabish 6e0256ca55 Added ability to disable Download Scanner by setting interval to 0 2014-01-19 10:35:51 -08:00
theguardian 7108398099 Added Twitter as a notification option. 2014-01-15 13:07:45 -08:00
rembo10 e879af6b0e Fix for transmission bug introduced in last update 2014-01-15 10:41:31 +00:00
rembo10 70eadcd330 Typo in fix for sending torrents to transmission 2014-01-15 10:40:55 +00:00
rembo10 ae9c1042cf Merge branch 'develop' 2014-01-15 10:37:07 +00:00
rembo10 d51cdca1d8 Fix for #1380: torrents no longer being sent to transmission 2014-01-15 10:36:38 +00:00
rembo10 327e4785c5 Merge branch 'develop' 2014-01-13 21:49:48 +00:00
Ade 2f9190dc34 rutracker website change 2014-01-13 21:48:46 +00:00
rembo10 88b277ea25 removed database locking 2014-01-13 15:49:17 +00:00
rembo10 d4fae1dd35 Removed database locking 2014-01-13 15:39:05 +00:00
rembo10 10f062201b Merge branch 'develop' 2014-01-13 10:44:36 +00:00
rembo10 be55a2e547 Merge remote-tracking branch 'djeebus/add_description_to_artist_api' into develop 2014-01-13 10:44:17 +00:00
rembo10 3ccfc9cea9 Added AdeHub's changes from here: https://github.com/rembo10/headphones/pull/1330 2014-01-13 10:39:58 +00:00
rembo10 31cdb095dc Took off a little of the transmission_host description text 2014-01-13 10:32:32 +00:00
rembo10 251c55d84c Merge remote-tracking branch 'Qt-dev/master' into develop 2014-01-13 10:31:22 +00:00
Joseph Lombrozo 594dc6acaa Tabs to spaces. Whoops! 2014-01-11 21:33:17 -08:00
Joseph Lombrozo b6965b3db3 Add description to the getArtist API response 2014-01-11 21:26:14 -08:00
Quentin 62f294a51d The transmission url detection now :
- is executed only if the url is not already ending with rpc
  - detects ports up to 6 digits long (changed from 4)
2014-01-11 13:19:15 +01:00
rembo10 435cd780b2 Fixed bug eliminating valid torrents due to maxsize with waffles 2013-12-19 17:15:34 +00:00
rembo10 9023f95e71 Merge remote-tracking branch 'PHiAX/patch-1' into develop 2013-12-19 16:50:57 +00:00
rembo10 c0d8ee17e8 Merge remote-tracking branch 'davidrot/master' into develop 2013-12-19 16:49:49 +00:00
rembo10 ded1657119 Merge remote-tracking branch 'cohena/develop' into develop 2013-12-19 16:48:12 +00:00
rembo10 bb270cc9e3 Merge remote-tracking branch 'stereoa/master' into develop 2013-12-19 16:47:06 +00:00
rembo10 4d69689dd9 Merge remote-tracking branch 'Bonham84/master' into develop 2013-12-19 16:37:57 +00:00
rembo10 6ffacc2fe9 Merge remote-tracking branch 'seif/omgwtfnzbs' into develop 2013-12-19 16:33:26 +00:00
rembo10 883b316f84 Merge remote-tracking branch 'theguardian/master' into develop 2013-12-19 16:24:08 +00:00
theguardian ecb402e10e Fixed bug where logger search froze on librarysync information 2013-12-14 09:03:14 -08:00
theguardian 5d41a3adb9 Fixed libraryscan to ignore unmatchable tracks unless something changes that makes them matchable.
Fixed some persistent bugs that were bothering me regarding newartists, etc
2013-12-13 17:00:59 -08:00
theguardian b1a47a2a91 Fixed minor bug where new releases wouldn't be updated. Improved logging to give better insights. 2013-12-11 14:47:28 -08:00
theguardian 4c8f933900 Added more release information to release database and "alternate albums" on album page. 2013-12-10 17:46:14 -08:00
theguardian fbb6413287 Fixed bug where specific releases would not show disambiguation in track title.
Releases should now be WYSIWYG reflection of musicbrainz.org (with the exception of multiple disc releases to be handled next).
2013-12-10 13:53:55 -08:00
theguardian cc61cc5c9f Fixed issue where matching introduced false positives if metadata has MusicBrainz Track ID set. 2013-12-08 15:20:32 -08:00
PHiAX 418f93ed96 Added | character to replacelist for folders.
I got this error, so tried to fix it.

08-dec-2013 21:38:53 - ERROR   :: Thread-143 : Could not create folder for Minor Earth | Major Sky. Not moving: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'Z:\\Music\\Album\\A\\a-ha\\minor earth | major sky [2000]'
2013-12-08 22:11:12 +01:00
davidrot bb36c914b7 Bug fix * character in filename 2013-12-08 11:58:12 +01:00
rembo10 a78dc78b95 Merge remote-tracking branch 'theguardian/master' into develop 2013-12-08 08:55:18 +01:00
cohena b30b472e58 Fix what.cd lossless searching 2013-12-01 20:11:01 -08:00
cohena 162c3cb604 Fix search hang in pygazelle if server didn't respond, timeout is now 30 secs 2013-12-01 19:43:00 -08:00
rembo10 8ded4b6edc Merge remote-tracking branch 'theguardian/master' into develop 2013-11-25 11:53:37 +01:00
stereoa 16dbe9a1cb made postprocessing not pop up subprocess window 2013-11-22 00:13:45 -05:00
rembo10 8ffd451832 Merge cohena critical fix for what.cd 2013-11-11 10:22:40 +01:00
rembo10 4dbf6fbf0c Merge remote-tracking branch 'cohena/develop' into develop 2013-11-11 10:19:30 +01:00
cohena 47fb5334cc Make gazelle api object persist to reduce number of login reattempts 2013-11-07 22:25:57 -08:00
cohena e18cb4c5c2 Fix another edge case login loop 2013-11-07 01:36:30 -08:00
cohena cb8a1c91a3 remove a bunch of old comments 2013-11-07 01:01:09 -08:00
cohena e62b85810e Fix requests import 2013-11-07 00:58:51 -08:00
cohena 3dc6417e7a Update pygazelle version, including CRITICAL login hammering fix 2013-11-07 00:51:18 -08:00
quentin b872966011 Added the possibility to make it work with transmission in a different subfolder 2013-11-05 14:50:34 +01:00
theguardian 17fb793833 Added indices on tracks/alltracks/have tables to speed up library sync & improve overall speed of browsing headphones. 2013-10-24 14:48:04 -07:00
theguardian af0e570b44 Fixed minor bug where track numbers were out of order on album page (due to new index) 2013-10-24 09:20:18 -07:00
theguardian 4c8f11555e Added database indices on allalbums/alltracks tables. Active artist update FLIES throughout the process when starting from scratch. 2013-10-23 21:34:12 -07:00
theguardian 6ebd26ecfd Fixed minor issue where manual 'have' tracks would be unmatched if a local file was deleted. 2013-10-23 17:31:21 -07:00
theguardian 8cd08401f5 Fixed Error '500' for Managed Manually Matched & Ignored 2013-10-15 21:07:44 -07:00
Bonham84 67dc54f01b Handle FLAC albumart correctly. 2013-10-15 23:53:31 +00:00
theguardian 467947d48e Don't attempt to match tracks that don't have enough information to make matching possible. 2013-10-15 10:20:08 -07:00
theguardian 94c404e7bd Fixed bug where untagged tracks would be passed to unmatched. These qualifiers should be treated separately. 2013-10-15 09:07:54 -07:00
theguardian 8fd631f96b Cleaned up unnecessary code. No longer suggested that users run a comprehensive active artist update on first-run. 2013-10-13 13:45:10 -07:00
theguardian f75d9bd50e Fixed havetrack counts in "Manage Albums" view with new system. 2013-10-13 09:43:20 -07:00
Seif Attar 8f4d048859 Add omgwtfnzbs search provider 2013-10-13 00:56:30 +01:00
theguardian 7a2c9ab25f Another fix to updater.py for a bug I mistakingly introduced earlier. 2013-10-12 11:51:05 -07:00
theguardian 38e9128f1a Fixed weird indentation error in updater.py that caused daemon to hang. 2013-10-12 11:46:38 -07:00
theguardian b015275d74 Forcing legacy (comprehensive) updates now nukes data tables, which unintuitively makes the process go MUCH faster. 2013-10-11 23:08:47 -07:00
theguardian b0d75b46ec Revamped "Manage Unmatched" page, added "Manage Manual" page. 2013-10-11 20:08:36 -07:00
rembo10 18c4b87158 Merge branch 'develop' 2013-10-11 13:58:23 +02:00
theguardian 4ea867836e Optimized a few scan functions. 2013-10-09 16:11:25 -07:00
theguardian 237e429669 Fixed a few minor bugs where library scan would overwrite cleanname of
manually matched track & delete artist would fail.
2013-10-09 11:55:29 -07:00
theguardian 9151a98656 I blame my cat for these oops-ies 2013-10-09 00:08:30 -07:00
theguardian 71607d4cf7 Stupid error. 2013-10-09 00:03:53 -07:00
theguardian fc00567191 First significant cut at refactoring the library sync function to optimize time/CPU usage.
Headphones now keeps all local file information persistent, and affords many new
opportunities that weren't available before.  There may be a bug here and there.  Please report.
2013-10-08 23:32:18 -07:00
theguardian 7a19d08ab2 Added ability to do a "comprehensive" MusicBrainz update to emulate the original update process.
Fixed a bug when adding albums introduced in last commit.
2013-10-02 15:03:25 -07:00
theguardian af97f16c25 Fixed bug where user-selected album release was overwritten by headphones hybrid release. 2013-10-02 11:26:06 -07:00
theguardian 75a5f86cde Added user inputs for MusicBrainz Update Interval & Album Age to ignore. 2013-10-02 10:18:14 -07:00
theguardian 9aa8bb8a72 Removed mb_lock from get_new_releases (which is how it was originally) - should fix database locking errors. 2013-10-02 09:34:00 -07:00
theguardian 4bbf067776 Fixed the bug where "Get Extras" caused albums to be deleted. Updated webserve.py to remove all traces of deleted items: necessary for this new algorithm to function globally. 2013-10-02 09:26:38 -07:00
theguardian 79f69f4e6e Minor modification to make logger reflect eventual user input variable 2013-10-01 23:59:47 -07:00
theguardian 239c9841a1 Reverted ignore date back to 365 days - seems good for now. 2013-10-01 18:06:27 -07:00
theguardian 3639220a82 Made a few minor syntax updates. 2013-10-01 17:27:00 -07:00
theguardian 8ef1fb45c8 Rehashed "update active artist" algorithm to address time/CPU load issues. 2013-10-01 12:25:09 -07:00
rembo10 e8829e36d8 Merge branch 'piratebay-proxy' into develop 2013-09-23 18:44:41 +05:30
rembo10 8a6c37bcf6 Added piratebay proxy url to config page 2013-09-23 18:44:11 +05:30
rembo10 6f8f2c292b Added ability to use a piratebay proxy to the backend 2013-09-23 18:27:27 +05:30
rembo10 5c60019d38 Use int(x,8) for file permissions 2013-09-21 11:33:18 +05:30
rembo10 8d6ff27882 Merge branch 'file-permissions' into develop 2013-09-09 14:20:44 +05:30
rembo10 d9cd120ca8 Fixed a typo, int() the permissions string 2013-09-09 14:20:34 +05:30
rembo10 2e1c9d7f84 Added file permissions & folder permissions to config page 2013-09-08 15:03:23 +05:30
rembo10 2f07d952b2 Added file_permissions to config & post processor 2013-09-08 14:57:17 +05:30
rembo10 dc69421f39 Bug fixes, added HTTPS support, music encoder fix, sanity checking for
transmission, piratebay torrage support
2013-08-26 15:15:43 +05:30
rembo10 70bcee2fa7 Merge remote-tracking branch 'coolbombom/master' into develop 2013-08-25 12:46:51 +05:30
rembo10 b8c2ad9c73 Merge remote-tracking branch 'bakie/feature/use_underscores' into develop 2013-08-24 10:26:36 +05:30
rembo10 e115d266ac Merge branch 'bug-fixes' into develop 2013-08-24 10:20:09 +05:30
rembo10 eed11d8493 Merge branch 'ssl-support' into develop 2013-08-24 10:19:54 +05:30
rembo10 7502959310 Changed waffles passkey to password input type 2013-08-24 10:19:02 +05:30
rembo10 2e55b0eb5b Modified gitignore to exclude cert & key files for https 2013-08-24 10:15:20 +05:30
rembo10 ea1d86b6b1 Added https options to web interface 2013-08-24 10:13:51 +05:30
rembo10 482cb68bd6 Fixed up some bugs/bad imports, added lib/certgen 2013-08-24 09:51:58 +05:30
rembo10 a5c087465c Added backend code for ssl support (init.py, webstart.py) 2013-08-24 09:20:37 +05:30
rembo10 28e1380c3a Merge remote-tracking branch 'AdeHub/master' into develop 2013-08-20 09:38:11 +05:30
rembo10 dd58d78f5f Fix for post-processing the same album multiple times if torrent download dir == nzb download dir 2013-08-14 12:03:50 +05:30
rembo10 411383c856 A little bit of error checking for Transmission 2013-08-14 11:40:34 +05:30
Bakie 0b22e5fde6 use underscores during rename and move 2013-08-11 17:19:15 +02:00
Ade 12dda31891 Encoder fix up
missed a couple of commas
2013-08-09 08:30:24 +12:00
rembo10 95bafed76a Fix for torrent temp-folder not being created when non-ascii chars in foldername 2013-08-06 10:00:41 -07:00
coolbombom 1084c11866 Update searcher.py 2013-08-06 12:08:26 +02:00
rembo10 24187955fa Merge branch 'torrent-quick-fixes' into develop 2013-08-05 19:56:59 -07:00
2063 changed files with 297625 additions and 170326 deletions
+30 -14
View File
@@ -1,31 +1,48 @@
[Tt]est[Rr]esult*
/cache
/logs
.project
.pydevproject
# Compiled source #
###################
# coverage generated
/cover-html/
.coverage
.coveralls.yml
# Compiled source
*.pyc
*.py~
*.pyproj
*.sln
# Logs and databases #
######################
# Headphones files
*.log
*.db*
*.db-journal
*.ini
version.lock
logs/*
cache/*
# OS generated files #
######################
# HTTPS Cert/Key
*.crt
*.key
*.csr
# OS generated files
.DS_Store?
.DS_Store
ehthumbs.db
Icon?
Thumbs.db
#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
# Ignore files generated by PyCharm
.idea/*
# Ignore files generated by vi
*.swp
# Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
@@ -50,8 +67,7 @@ Thumbs.db
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
/cache
/logs
.project
.pydevproject
.vscode
# Python virtual env
venv
+7
View File
@@ -0,0 +1,7 @@
[pep8]
# E126 continuation line over-indented for hanging indent
# E127 continuation line over-indented for visual indent
# E128 continuation line under-indented for visual indent
# E501 line too long (312 > 160 characters)
ignore = E123,E126,E127,E128,E501
max-line-length = 160
+25
View File
@@ -0,0 +1,25 @@
# Travis CI configuration file
# http://about.travis-ci.org/docs/
language: python
sudo: false
cache:
pip: true
directories:
- lib
python:
- "2.7"
install:
- pip install -r requirements-dev.txt
script:
- pep8 headphones
- pyflakes headphones
- nosetests
after_success:
- if [[ $TRAVIS_PYTHON_VERSION == "2.7" ]]; then coveralls; fi
+111
View File
@@ -0,0 +1,111 @@
# API Reference
The API is still pretty new and needs some serious cleaning up on the backend but should be reasonably functional. There are no error codes yet.
## General structure
The API endpoint is `http://ip:port + HTTP_ROOT + /api?apikey=$apikey&cmd=$command`
Data response in JSON formatted. If executing a command like "delArtist" or "addArtist" you'll get back an "OK", else, you'll get the data you requested.
## API methods
### getIndex
Fetch data from index page. Returns: ArtistName, ArtistSortName, ArtistID, Status, DateAdded, [LatestAlbum, ReleaseDate, AlbumID], HaveTracks, TotalTracks, IncludeExtras, LastUpdated, [ArtworkURL, ThumbURL]: a remote url to the artwork/thumbnail.
To get the cached image path, see getArtistArt command. ThumbURL is added/updated when an artist is added/updated. If your using the database method to get the artwork, it's more reliable to use the ThumbURL than the ArtworkURL)
### getArtist&id=$artistid
Fetch artist data. returns the artist object (see above) and album info: Status, AlbumASIN, DateAdded, AlbumTitle, ArtistName, ReleaseDate, AlbumID, ArtistID, Type, ArtworkURL: hosted image path. For cached image, see getAlbumArt command)
### getAlbum&id=$albumid
Fetch data from album page. Returns the album object, a description object and a tracks object. Tracks contain: AlbumASIN, AlbumTitle, TrackID, Format, TrackDuration (ms), ArtistName, TrackTitle, AlbumID, ArtistID, Location, TrackNumber, CleanName (stripped of punctuation /styling), BitRate)
### getUpcoming
Returns: Status, AlbumASIN, DateAdded, AlbumTitle, ArtistName, ReleaseDate, AlbumID, ArtistID, Type
### getWanted
Returns: Status, AlbumASIN, DateAdded, AlbumTitle, ArtistName, ReleaseDate, AlbumID, ArtistID, Type
### getSimilar
Returns similar artists - with a higher "Count" being more likely to be similar. Returns: Count, ArtistName, ArtistID
### getHistory
Returns: Status, DateAdded, Title, URL (nzb), FolderName, AlbumID, Size (bytes)
### getLogs
Not working yet
### findArtist&name=$artistname[&limit=$limit]
Perform artist query on musicbrainz. Returns: url, score, name, uniquename (contains disambiguation info), id)
### findAlbum&name=$albumname[&limit=$limit]
Perform album query on musicbrainz. Returns: title, url (artist), id (artist), albumurl, albumid, score, uniquename (artist - with disambiguation)
### addArtist&id=$artistid
Add an artist to the db by artistid)
### addAlbum&id=$releaseid
Add an album to the db by album release id
### delArtist&id=$artistid
Delete artist from db by artistid)
### pauseArtist&id=$artistid
Pause an artist in db)
### resumeArtist&id=$artistid
Resume an artist in db)
### refreshArtist&id=$artistid
Refresh info for artist in db from musicbrainz
### queueAlbum&id=$albumid[&new=True&lossless=True]
Mark an album as wanted and start the searcher. Optional paramters: 'new' looks for new versions, 'lossless' looks only for lossless versions
### unqueueAlbum&id=$albumid
Unmark album as wanted / i.e. mark as skipped
### forceSearch
force search for wanted albums - not launched in a separate thread so it may take a bit to complete
### forceProcess[&dir=/path/to/folder]
Force post process albums in download directory - also not launched in a separate thread
### forceActiveArtistsUpdate
force Active Artist Update - also not launched in a separate thread
### getVersion
Returns some version information: git_path, install_type, current_version, installed_version, commits_behind
### checkGithub
Updates the version information above and returns getVersion data
### shutdown
Shut down headphones
### restart
Restart headphones
### update
Update headphones - you may want to check the install type in get version and not allow this if type==exe
### getArtistArt&id=$artistid
Returns either a relative path to the cached image, or a remote url if the image can't be saved to the cache dir
getAlbumArt&id=$albumid
see above
### getArtistInfo&id=$artistid
Returns Summary and Content, both formatted in html.
### getAlbumInfo&id=$albumid
See above, returns Summary and Content.
### getArtistThumb&id=$artistid
Returns either a relative path to the cached thumbnail artist image, or an http:// address if the cache dir can't be written to.
### getAlbumThumb&id=$albumid
See above.
### choose_specific_download&id=$albumid
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
### download_specific_release&id=albumid&title=$title&size=$size&url=$url&provider=$provider&kind=$kind
Allows you to manually pass a choose_specific_download release back to searcher.send_to_downloader()
-67
View File
@@ -1,67 +0,0 @@
The API is still pretty new and needs some serious cleaning up on the backend but should be
reasonably functional. There are no error codes yet,
General structure:
http://localhost:8181 + HTTP_ROOT + /api?apikey=$apikey&cmd=$command
Data returned in json format. If executing a command like "delArtist" or "addArtist" you'll get back an "OK", else, you'll get the data you requested
$commands&parameters[&optionalparameters]:
getIndex (fetch data from index page. Returns: ArtistName, ArtistSortName, ArtistID, Status, DateAdded,
[LatestAlbum, ReleaseDate, AlbumID], HaveTracks, TotalTracks,
IncludeExtras, LastUpdated, [ArtworkURL, ThumbURL]: a remote url to the artwork/thumbnail. To get the cached image path, see getArtistArt command.
ThumbURL is added/updated when an artist is added/updated. If your using the database method to get the artwork,
it's more reliable to use the ThumbURL than the ArtworkURL)
getArtist&id=$artistid (fetch artist data. returns the artist object (see above) and album info: Status, AlbumASIN, DateAdded, AlbumTitle, ArtistName, ReleaseDate, AlbumID, ArtistID, Type, ArtworkURL: hosted image path. For cached image, see getAlbumArt command)
getAlbum&id=$albumid (fetch data from album page. Returns the album object, a description object and a tracks object. Tracks contain: AlbumASIN, AlbumTitle, TrackID, Format, TrackDuration (ms), ArtistName, TrackTitle, AlbumID, ArtistID, Location, TrackNumber, CleanName (stripped of punctuation /styling), BitRate)
getUpcoming (Returns: Status, AlbumASIN, DateAdded, AlbumTitle, ArtistName, ReleaseDate, AlbumID, ArtistID, Type)
getWanted (Returns: Status, AlbumASIN, DateAdded, AlbumTitle, ArtistName, ReleaseDate, AlbumID, ArtistID, Type)
getSimilar (Returns similar artists - with a higher "Count" being more likely to be similar. Returns: Count, ArtistName, ArtistID)
getHistory (Returns: Status, DateAdded, Title, URL (nzb), FolderName, AlbumID, Size (bytes))
getLogs (not working yet)
findArtist&name=$artistname[&limit=$limit] (perform artist query on musicbrainz. Returns: url, score, name, uniquename (contains disambiguation info), id)
findAlbum&name=$albumname[&limit=$limit] (perform album query on musicbrainz. Returns: title, url (artist), id (artist), albumurl, albumid, score, uniquename (artist - with disambiguation)
addArtist&id=$artistid (add an artist to the db by artistid)
addAlbum&id=$releaseid (add an album to the db by album release id)
delArtist&id=$artistid (delete artist from db by artistid)
pauseArtist&id=$artistid (pause an artist in db)
resumeArtist&id=$artistid (resume an artist in db)
refreshArtist&id=$artistid (refresh info for artist in db from musicbrainz)
queueAlbum&id=$albumid[&new=True&lossless=True] (Mark an album as wanted and start the searcher. Optional paramters: 'new' looks for new versions, 'lossless' looks only for lossless versions)
unqueueAlbum&id=$albumid (Unmark album as wanted / i.e. mark as skipped)
forceSearch (force search for wanted albums - not launched in a separate thread so it may take a bit to complete)
forceProcess (force post process albums in download directory - also not launched in a separate thread)
getVersion (Returns some version information: git_path, install_type, current_version, installed_version, commits_behind
checkGithub (updates the version information above and returns getVersion data)
shutdown (shut down headphones)
restart (restart headphones)
update (update headphones - you may want to check the install type in get version and not allow this if type==exe)
getArtistArt&id=$artistid (Returns either a relative path to the cached image, or a remote url if the image can't be saved to the cache dir)
getAlbumArt&id=$albumid (see above)
getArtistInfo&id=$artistid (Returns Summary and Content, both formatted in html)
getAlbumInfo&id=$albumid (See above, returns Summary and Content)
getArtistThumb&id=$artistid (Returns either a relative path to the cached thumbnail artist image, or an http:// address if the cache dir can't be written to)
getAlbumThumb&id=$albumid (see above)
+414
View File
@@ -0,0 +1,414 @@
# Changelog
## v0.6.3
Released 26 May 2024
Highlights:
* Hotfix for searcher not returning results
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.6.2...v0.6.3).
## v0.6.2
Released 26 May 2024
Highlights:
* Added soulseek support
* Added bandcamp support
* Changes and dependency updates to work with Python >= 3.12
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.6.1...v0.6.2).
## v0.6.1
R eleased 26 November 2023
Highlights:
* Dependency updates to work with > Python 3.11
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.6.0...v0.6.1).
## v0.6.0
Released 13 November 2022
Highlights:
* Updated to python 3
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.20...v0.6.0).
## v0.5.20
Released 15 October 2021
Highlights:
* Improved: Last.fm & metacrtic api fixes
* Improved: Various database fixes
* Added: qBitTorrent
* Added: Telegram notifications
* Improved: Many more since the last release. Check the list
Many thanks to @AdeHub for keeping the ship afloat
and to everyone else who contributed.
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.19...v0.5.20).
## v0.5.19
Released 27 March 2018
Highlights:
* Improved: Windows encoding fixes
* Improved: Performance enhancements
* Improved: Many more since the last release. Check the list
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.18...v0.5.19).
## v0.5.18
Released 01 December 2016
Highlights:
* Added: PassTheHeadphones support
* Fixed: Special characters in password fields breaking on config page
* Improved: Updated t411 url
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.17...v0.5.18).
## v0.5.17
Released 10 November 2016
Highlights:
* Added: t411 support
* Fixed: Rutracker login
* Fixed: Deluge empty password
* Fixed: FreeBSD init script
* Improved: Musicbrainz searching
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.16...v0.5.17).
## v0.5.16
Released 10 June 2016
Hotfix update
Highlights:
* Fixed: Waffles url
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.15...v0.5.16).
## v0.5.15
Released 07 June 2016
Hotfix update
Highlights:
* Fixed: Update vip mirror url to point to new server
* Fixed: Update waffles url to .ch
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.14...v0.5.15).
## v0.5.14
Released 02 June 2016
Highlights:
* Fixed: File/folder format on new installs
* Fixed: Pep8 errors
* Improved: Updated fontawesome
* Improved: Reverted back to less
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.13...v0.5.14).
## v0.5.13
Released 25 February 2016
Another hotfix update
Highlights:
* Fixed: Saving config with non-defined options
* Fixed: Pep8 errors
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.12...v0.5.13).
## v0.5.12
Released 25 February 2016
This is mostly a hotfix update
Highlights:
* Added: Experimental Deluge Support
* Fixed: Some pep8 stuff
* Improved: Use curly braces for pathrender optional variables
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.11...v0.5.12).
## v0.5.11
Released 20 February 2016
Highlights:
* Added: Soft chroot option
* Fixed: Post processing temporary directory fix (#2504)
* Fixed: Ubuntu init script (#2509)
* Fixed: Image cache uncaught exception (#2485)
* Improved: $Date/$date variable in folder renaming
* Improved: Reuse transmission session id
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.10...v0.5.11).
## v0.5.10
Released 29 January 2016
Highlights:
* Added: API option to post-process single folders
* Added: Ability to specify extension when re-encoding
* Added: Option to stop renaming folders
* Fixed: Utorrent torrents not being removed (#2385)
* Fixed: Torznab to transmission
* Fixed: Magnet folder names in history
* Fixed: Multiple torcache fixes
* Fixed: Updated requests & urllib3 to latest versions to fix errors with pyOpenSSL
* Improved: Use a temporary folder during post-processing
* Improved: Added verify_ssl_cert option
* Improved: Fixed track matching progress
* Improved: pylint, pep8 & pylint fixes
* Improved: Stop JS links from scrolling to the top of the page
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.9...v0.5.10).
## v0.5.9
Released 05 September 2015
Highlights:
* Added: Providers Strike, Jackett, custom Torznabs
* Added: Option to stop post-processing if no good match found (#2343)
* Fixed: Blackhole -> Magnet, limit to torcache
* Fixed: Kat 403 flac error
* Fixed: Last.fm errors
* Fixed: Pushover notifications
* Improved: Rutracker logging, switched to requests lib
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.8...v0.5.9).
## v0.5.8
Released 13 July 2015
Highlights:
* Added: Option to only include official extras
* Added: Option to wait until album release date before searching
* Fixed: NotifyMyAndroid notifications
* Fixed: Plex Notifications
* Fixed: Metacritic parsing
* Fixed: Pushbullet notifications
* Fixed: What.cd not honoring custom search term (#2279)
* Improved: XSS Search bug
* Improved: Config page layout
* Improved: Set localhost as default
* Improved: Better single artist scanning
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.7...v0.5.8).
## v0.5.7
Released 01 July 2015
Highlights:
* Improved: Moved pushover to use requests lib
* Improved: Plex tokens with Plex Home
* Improved: Added getLogs & clearLogs to api
* Improved: Cache MetaCritic scores. Added user-agent header to fix 403 errors
* Improved: Specify whether to delete folders when force post-processing
* Improved: Convert target bitrate to vbr preset for what.cd searching
* Improved: Switched Pushover to requests lib
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.6...v0.5.7).
## v0.5.6
Released 08 June 2015
Highlights:
* Added: Metacritic scores
* Added: Series support (e.g. Cafe Del Mar, Now That's What I Call Music, etc)
* Added: Filter out clean/edited/censored releases (#2198)
* Added: Button on the log page to toggle verbose/debug logging
* Fixed: Connecting to SABnzbd over https with python >= 2.7.9
* Fixed: Email Notifications with SSL
* Fixed: Don't limit musicbrainz results to first 100
* Fixed: nzbget url fix
* Fixed: OSX Notifications
* Improved: Cuesplit, allow wav, ape to be split
* Improved: Moved the 'freeze db' option to the advanced->misc. tab
* Improved: Moved kickass searching to json api, so it doesn't throw 404 errors anymore when there are no results
* Improved: SSL for headphones indexer
* Improved: Disable update dialog box if check_github is diabled
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.5...v0.5.6).
## v0.5.5
Released 04 May 2015
Highlights:
* Added: force ID3v2.3 during post processing (#2121)
* Added: MusicBrainz authentication (#2125)
* Added: Email notifications (addresses #1045)
* Fixed: Kickass url updated to kickass.to (#2119)
* Fixed: Piratebay returning 0 bytes for all files
* Fixed: Albums stopped automatically refreshing when adding an artist
* Fixed: Min/max sizes for target bitrate
* Fixed: Don't filter any results if looking for a specific download
* Fixed: Sort by size in the specific download table
* Fixed: Deal with beets recommendation.none correctly
* Improved: Close dialog window automatically when choosing a specific download
* Improved: Move some repetitive log messages to debug level
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.4...v0.5.5).
## v0.5.4
Released 05 February 2015
Highlights:
* Added: backported 'Scan Artist' feature from `sarakha63/headphones`
* Fixed: change file permissions of cache files according to settings (#2102)
* Fixed: hide Songkick if no regional events are available
* Fixed: only reschedule jobs if timeout changed (#2099)
* Fixed: limit dialog height (#2096)
* Improved: upgraded requests to 2.5.1
* Improved: upgraded unidecode to 0.04.17
* Improved: upgraded tzlocal to 1.1.2
* Improved: upgraded PyTZ to 2014.10
* Improved: upgraded mako to 1.0.1
* Improved: upgraded mutagen to 1.27
* Improved: upgraded beets to 1.3.10
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.3...v0.5.4).
## v0.5.3
Released 15 January 2015
Highlights:
* Added: update active artists via API (#2075)
* Fixed: queue instance lacks `add` method (#2055)
* Improved: better SSL error messages (#2058)
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.2...v0.5.3).
## v0.5.2
Released 28 December 2014
Highlights:
* Added: advanced option to ignore certain folders by patterns. (#2037)
* Added: advanced option to ignore certain files by patterns (library only)
* Added: specify optional paths to CUE splitting tools (#1938)
* Added: experimental support for OPB (provide details yourself!)
* Fixed: magnet to torrent conversion (#1926)
* Fixed: new KAT URL (#2043)
* Fixed: LMS notifications (#1564)
* Improved: notify user of SSL-related warnings, instead of silently failing.
* Improved: show all search results for 'Choose Specific Release'
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.1...v0.5.2).
## v0.5.1
Released 13 November 2014
Highlights:
* Added: allow one to disable interval tasks (#2002)
* Added: script to downgrade Headphones to last version that started (Linux only)
* Fixed: SSL issues in CherryPy. Self-generated certificates will be 2048 now (#1995)
* Fixed: Transmission URL detection (#1998)
* Fixed: missing dependencies for APScheduler and CherryPy (#2001)
* Improved: symlink infinite recursion detection
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5...v0.5.1).
## v0.5
Released 10 November 2014
Highlights:
* Added: CUE splitter
* Added: filter search result by MusicBrainz Release Group ID
* Added: follow symlinks while scanning library (#1953)
* Fixed: crash during post processing (#1897)
* Fixed: embedding lyrics (#1896)
* Fixed: HTTP errors with older versions of Python 2.6
* Fixed: jump back to top of page (#1948)
* Improved: parse MusicBrainz RGID first when post processing (#1952)
* Improved: Growl unicode characters (#1695)
* Improved: search handling for PB and KAT
* Improved: Last.FM API support (#1877)
* Improved: upgraded CherryPy to version 3.6.0
* Improved: upgraded Requests to version 2.4.1
* Improved: upgraded APScheduler to version 3.0.1
* Improved: lot of code refactoring
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.4...v0.5).
## v0.4
Released 20 September 2014
Highlights:
* Added: support for libav-tools (which replaces FFmpeg under Ubuntu)
* Added: option to freeze library when post processing
* Added: Songkick per area
* Added: rename original NFO file (#1797)
* Removed: removed dead search providers
* Fixed: removed left-overs of old packages
* Improved: rename by original folder (#1811)
* Improved: uTorrent fixess
* Improved: delayed loading of album art
* Improved: search result parser
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.3.4...v0.4).
## v0.3.4
Released 15 May 2014
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.3.3...v0.3.4).
## v0.3.3
Released 05 May 2014
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.3.2...v0.3.3).
## v0.3.2
Released 17 April 2014
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.3.1...v0.3.2).
## v0.3.1
Released 11 April 2014
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.3...v0.3.1).
## v0.3
Released 09 April 2014
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.2.3...v0.3).
## v0.2.3
Released 28 March 2014
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.2.2...v0.2.3).
## v0.2.2
Released 15 January 2014
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.2.1...v0.2.2).
## v0.2.1
Released 13 January 2014
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.2...v0.2.1).
## v0.2
Released 13 January 2014
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.1.2...v0.2).
## v0.1.2
Released 11 October 2013
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.1.1...v0.1.2).
## v0.1.1
Released 26 August 2013
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.1...v0.1.1).
## v0.1
Released 05 August 2013
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/2156e1341405d07c5bcfbe994f6b354b32d94cda...v0.1).
+52
View File
@@ -0,0 +1,52 @@
# Contributing to Headphones
## Issues
In case you read this because you are posting an issue, please take a minute and conside the things below. The issue tracker is not a support forum. It is primarily intended to submit bugs, improvements or feature requests. However, we are glad to help you, and make sure the problem is not caused by Headphones, but don't expect step-by-step answers.
* Use the search function. Chances are that your problem is already discussed. Do not append to (closed) issues if your problem does not fit the discussion.
* Visit the [Troubleshooting](../../wiki/TroubleShooting) wiki first.
* Use [proper formatting](https://help.github.com/articles/github-flavored-markdown/). Paste your logs in code blocks.
* Close your issue if you resolved it.
## Pull Requests
If you think you can contribute code to the Headphones repository, do not hesitate to submit a pull request.
### Branches
All pull requests should be based on the `develop` branch, to minimize cross merges. When you want to develop a new feature, clone the repository with `git clone origin/develop -b FEATURE_NAME`. Use meaningful commit messages.
### Python Code
#### Compatibility
The code should work with Python 2.6 and 2.7. Note that Headphones runs on different platforms, including Network Attached Storage devices such as Synology.
Re-use existing code. Do not hesitate to add logging in your code. You can the logger module `headphones.logger.*` for this. Web requests are invoked via `headphones.request.*` and derived ones. Use these methods to automatically add proper and meaningful error handling.
#### Code conventions
Although Headphones did not adapt a code convention in the past, we try to follow the [PEP8](http://legacy.python.org/dev/peps/pep-0008/) conventions for future code. A short summary to remind you (copied from http://wiki.ros.org/PyStyleGuide):
* 4 space indentation
* 80 characters per line
* `package_name`
* `ClassName`
* `method_name`
* `field_name`
* `_private_something`
* `self.__really_private_field`
* `_global`
#### Documentation
Document your code. Use docstrings See [PEP-257](https://www.python.org/dev/peps/pep-0257/) for more information.
#### Continuous Integration
Headphones has a configuration file for [travis-ci](https://travis-ci.org/). You can add your forked repo to Travis to have it check your code against PEP8, PyLint, and PyFlakes for you. Your pull request will show a green check mark or a red cross on each tested commit, depending on if linting passes.
### HTML/Template code
#### Compatibility
HTML5 compatible browsers are targetted. There is no specific mobile version of Headphones yet.
#### Conventions
* 4 space indentation
* `methodName`
* `variableName`
* `ClassName`
+118 -63
View File
@@ -14,26 +14,34 @@
# You should have received a copy of the GNU General Public License
# along with Headphones. If not, see <http://www.gnu.org/licenses/>.
import os, sys, locale
import time
import signal
import os
import sys
from lib.configobj import ConfigObj
if sys.version_info <= (3, 6):
sys.stdout.write("Headphones requires Python >= 3.7\n")
sys.exit(1)
import headphones
# Ensure lib added to path, before any other imports
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib/'))
from headphones import webstart, logger
try:
import argparse
except ImportError:
import lib.argparse as argparse
import locale
import time
import signal
import argparse
import headphones
# Register signals, such as CTRL + C
signal.signal(signal.SIGINT, headphones.sig_handler)
signal.signal(signal.SIGTERM, headphones.sig_handler)
def main():
"""
Headphones application entry point. Parses arguments, setups encoding and
initializes the application.
"""
# Fixed paths to Headphones
if hasattr(sys, 'frozen'):
@@ -50,7 +58,10 @@ def main():
try:
locale.setlocale(locale.LC_ALL, "")
headphones.SYS_ENCODING = locale.getpreferredencoding()
if headphones.SYS_PLATFORM == 'win32':
headphones.SYS_ENCODING = sys.getdefaultencoding().upper()
else:
headphones.SYS_ENCODING = locale.getpreferredencoding()
except (locale.Error, IOError):
pass
@@ -59,111 +70,155 @@ def main():
headphones.SYS_ENCODING = 'UTF-8'
# Set up and gather command line arguments
parser = argparse.ArgumentParser(description='Music add-on for SABnzbd+')
parser = argparse.ArgumentParser(
description='Music add-on for SABnzbd+, Transmission and more.')
parser.add_argument('-v', '--verbose', action='store_true', help='Increase console logging verbosity')
parser.add_argument('-q', '--quiet', action='store_true', help='Turn off console logging')
parser.add_argument('-d', '--daemon', action='store_true', help='Run as a daemon')
parser.add_argument('-p', '--port', type=int, help='Force Headphones to run on a specified port')
parser.add_argument('--datadir', help='Specify a directory where to store your data files')
parser.add_argument(
'-v', '--verbose', action='store_true', help='Increase console logging verbosity')
parser.add_argument(
'-q', '--quiet', action='store_true', help='Turn off console logging')
parser.add_argument(
'-d', '--daemon', action='store_true', help='Run as a daemon')
parser.add_argument(
'-p', '--port', type=int, help='Force Headphones to run on a specified port')
parser.add_argument(
'--datadir', help='Specify a directory where to store your data files')
parser.add_argument('--config', help='Specify a config file to use')
parser.add_argument('--nolaunch', action='store_true', help='Prevent browser from launching on startup')
parser.add_argument('--pidfile', help='Create a pid file (only relevant when running as a daemon)')
parser.add_argument('--nolaunch', action='store_true',
help='Prevent browser from launching on startup')
parser.add_argument(
'--pidfile', help='Create a pid file (only relevant when running as a daemon)')
parser.add_argument(
'--host', help='Specify a host (default - localhost)')
args = parser.parse_args()
if args.verbose:
headphones.VERBOSE = 2
elif args.quiet:
headphones.VERBOSE = 0
headphones.VERBOSE = True
if args.quiet:
headphones.QUIET = True
# Do an intial setup of the logger.
logger.initLogger(console=not headphones.QUIET, log_dir=False,
verbose=headphones.VERBOSE)
if args.daemon:
if sys.platform == 'win32':
print "Daemonize not supported under Windows, starting normally"
sys.stderr.write(
"Daemonizing not supported under Windows, starting normally\n")
else:
headphones.DAEMON=True
headphones.VERBOSE = False
headphones.DAEMON = True
headphones.QUIET = True
if args.pidfile:
headphones.PIDFILE = str(args.pidfile)
# If the pidfile already exists, headphones may still be running, so exit
# If the pidfile already exists, headphones may still be running, so
# exit
if os.path.exists(headphones.PIDFILE):
sys.exit("PID file '" + headphones.PIDFILE + "' already exists. Exiting.")
raise SystemExit("PID file '%s' already exists. Exiting." %
headphones.PIDFILE)
# The pidfile is only useful in daemon mode, make sure we can write the file properly
# The pidfile is only useful in daemon mode, make sure we can write the
# file properly
if headphones.DAEMON:
headphones.CREATEPID = True
try:
file(headphones.PIDFILE, 'w').write("pid\n")
except IOError, e:
raise SystemExit("Unable to write PID file: %s [%d]" % (e.strerror, e.errno))
else:
logger.warn("Not running in daemon mode. PID file creation disabled.")
try:
with open(headphones.PIDFILE, 'w') as fp:
fp.write("pid\n")
except IOError as e:
raise SystemExit("Unable to write PID file: %s", e)
else:
logger.warn("Not running in daemon mode. PID file creation " \
"disabled.")
# Determine which data directory and config file to use
if args.datadir:
headphones.DATA_DIR = args.datadir
else:
headphones.DATA_DIR = headphones.PROG_DIR
if args.config:
headphones.CONFIG_FILE = args.config
config_file = args.config
else:
headphones.CONFIG_FILE = os.path.join(headphones.DATA_DIR, 'config.ini')
config_file = os.path.join(headphones.DATA_DIR, 'config.ini')
# Try to create the DATA_DIR if it doesn't exist
if not os.path.exists(headphones.DATA_DIR):
try:
os.makedirs(headphones.DATA_DIR)
except OSError:
raise SystemExit('Could not create data directory: ' + headphones.DATA_DIR + '. Exiting....')
raise SystemExit(
'Could not create data directory: ' + headphones.DATA_DIR + '. Exiting....')
# Make sure the DATA_DIR is writeable
if not os.access(headphones.DATA_DIR, os.W_OK):
raise SystemExit('Cannot write to the data directory: ' + headphones.DATA_DIR + '. Exiting...')
raise SystemExit(
'Cannot write to the data directory: ' + headphones.DATA_DIR + '. Exiting...')
# Put the database in the DATA_DIR
headphones.DB_FILE = os.path.join(headphones.DATA_DIR, 'headphones.db')
headphones.CFG = ConfigObj(headphones.CONFIG_FILE, encoding='utf-8')
# Read config & start logging
headphones.initialize()
# Read config and start logging
try:
headphones.initialize(config_file)
except headphones.exceptions.SoftChrootError as e:
raise SystemExit('FATAL ERROR')
if headphones.DAEMON:
if sys.platform == "win32":
print "Daemonize not supported under Windows, starting normally"
else:
headphones.daemonize()
headphones.daemonize()
#configure the connection to the musicbrainz database
# Configure the connection to the musicbrainz database
headphones.mb.startmb()
# Force the http port if neccessary
if args.port:
http_port = args.port
logger.info('Starting Headphones on forced port: %i' % http_port)
logger.info('Using forced web server port: %i', http_port)
else:
http_port = int(headphones.HTTP_PORT)
http_port = int(headphones.CONFIG.HTTP_PORT)
# Try to start the server.
webstart.initialize({
'http_port': http_port,
'http_host': headphones.HTTP_HOST,
'http_root': headphones.HTTP_ROOT,
'http_proxy': headphones.HTTP_PROXY,
'http_username': headphones.HTTP_USERNAME,
'http_password': headphones.HTTP_PASSWORD,
})
# Force the http host if neccessary
if args.host:
http_host = args.host
logger.info('Using forced web server host: %s', http_host)
else:
http_host = headphones.CONFIG.HTTP_HOST
logger.info('Starting Headphones on port: %i' % http_port)
# Check if pyOpenSSL is installed. It is required for certificate generation
# and for CherryPy.
if headphones.CONFIG.ENABLE_HTTPS:
try:
import OpenSSL
except ImportError:
logger.warn("The pyOpenSSL module is missing. Install this " \
"module to enable HTTPS. HTTPS will be disabled.")
headphones.CONFIG.ENABLE_HTTPS = False
if headphones.LAUNCH_BROWSER and not args.nolaunch:
headphones.launch_browser(headphones.HTTP_HOST, http_port, headphones.HTTP_ROOT)
# Try to start the server. Will exit here is address is already in use.
web_config = {
'http_port': http_port,
'http_host': http_host,
'http_root': headphones.CONFIG.HTTP_ROOT,
'http_proxy': headphones.CONFIG.HTTP_PROXY,
'enable_https': headphones.CONFIG.ENABLE_HTTPS,
'https_cert': headphones.CONFIG.HTTPS_CERT,
'https_key': headphones.CONFIG.HTTPS_KEY,
'http_username': headphones.CONFIG.HTTP_USERNAME,
'http_password': headphones.CONFIG.HTTP_PASSWORD,
}
webstart.initialize(web_config)
# Start the background threads
headphones.start()
# Open webbrowser
if headphones.CONFIG.LAUNCH_BROWSER and not args.nolaunch:
headphones.launch_browser(headphones.CONFIG.HTTP_HOST, http_port,
headphones.CONFIG.HTTP_ROOT)
# Wait endlessy for a signal to happen
while True:
if not headphones.SIGNAL:
try:
@@ -171,7 +226,8 @@ def main():
except KeyboardInterrupt:
headphones.SIGNAL = 'shutdown'
else:
logger.info('Received signal: ' + headphones.SIGNAL)
logger.info('Received signal: %s', headphones.SIGNAL)
if headphones.SIGNAL == 'shutdown':
headphones.shutdown()
elif headphones.SIGNAL == 'restart':
@@ -181,7 +237,6 @@ def main():
headphones.SIGNAL = None
return
# Call main()
if __name__ == "__main__":
main()
View File
+67 -44
View File
@@ -1,44 +1,67 @@
#![preview thumb](https://github.com/rembo10/headphones/raw/master/data/images/headphoneslogo.png)Headphones
###Installation and Notes
This is a relatively early release of a third-party add-on for SABnzbd. It's been around for about a year, and while
quite functional, there are still a lot of kinks to work out!
To run it, just double-click the Headphones.py file (in Windows - you may need to right click and click 'Open With' -> Python) or launch a terminal, cd into the Headphones directory and run 'python headphones.py'.
For additional startup options, type 'python Headphones.py -h' or 'python Headphones.py --help'
###Screenshots
Homepage (Artist Overview)
![preview thumb](http://i.imgur.com/LZO9a.png)
One of the many settings pages....
![preview thumb](http://i.imgur.com/xcWNy.png)
It might even know you better than you know yourself:
![preview thumb](http://i.imgur.com/R7J0f.png)
Import Your Favorite Artists:
![preview thumb](http://i.imgur.com/6tZoC.png)
Artist Search Results (also search by album!):
![preview thumb](http://i.imgur.com/rIV0P.png)
Artist Page with Bio & Album Overview:
![preview thumb](http://i.imgur.com/SSil1.png)
Album Page with track overview:
![preview thumb](http://i.imgur.com/kcjES.png)
If you run into any issues, use the GitHub issue tracker at: http://github.com/rembo10/headphones/issues.
This is free software under the GPL v3 open source license - so feel free to do with it what you wish.
## ![Headphones Logo](https://github.com/rembo10/headphones/raw/master/data/images/headphoneslogo.png) Headphones
[![Build Status](https://travis-ci.org/rembo10/headphones.svg?branch=master)](https://travis-ci.org/rembo10/headphones)
[![Build Status](https://img.shields.io/travis/rembo10/headphones/develop.svg?label=develop%20branch%20build)](https://travis-ci.org/rembo10/headphones)
Headphones is an automated music downloader for NZB and Torrent, written in Python. It supports SABnzbd, NZBget, Transmission, µTorrent, Deluge and Blackhole.
## Support & Discuss
You are free to join the Headphones support community on IRC where you can ask questions, hang around and discuss anything related to HP.
1. Use any IRC client and connect to the Freenode server, `irc.freenode.net`.
2. Join the `#headphones` channel.
## Installation and Notes
* [Installation page](../../wiki/Installation) shows you how to install Headphones.
* [Usage guide](../../wiki/Usage-guide) introduces you to Headphones.
* [Troubleshooting page](../../wiki/TroubleShooting) in the wiki can help you with common problems.
**Issues** can be reported on the GitHub issue tracker considering these rules:
1. Analyze your log, you just might find the solution yourself!
2. You read the wiki and searched existing issues, but this is not solving your problem.
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).
4. Close your issue when it's solved! If you found the solution yourself, please comment so that others benefit from it.
**Feature requests** can be reported on the GitHub issue tracker too:
1. Search for similar existing 'issues', feature requests can be recognized by the label 'Request'.
2. If a similar Request exists, post a comment (+1, or add a new idea to the existing request), otherwise you can create a new one.
If you **comply with these rules** you can [post your request/issue](http://github.com/rembo10/headphones/issues).
**Support** the project by implementing new features, solving support tickets and provide bug fixes.
## Screenshots
Homepage (Artist Overview):
![preview thumb](http://i.imgur.com/LZO9a.png)
One of the many settings pages:
![preview thumb](http://i.imgur.com/xcWNy.png)
It might even know you better than you know yourself:
![preview thumb](http://i.imgur.com/R7J0f.png)
Import Your Favorite Artists:
![preview thumb](http://i.imgur.com/6tZoC.png)
Search Results:
![preview thumb](http://i.imgur.com/rIV0P.png)
Artist Page with Bio & Album Overview:
![preview thumb](http://i.imgur.com/SSil1.png)
Album Page with track overview:
![preview thumb](http://i.imgur.com/kcjES.png)
## License
This is free software under the GPL v3 open source license. Feel free to do with it what you wish, but any modification must be open sourced. A copy of the license is included.
-8
View File
@@ -1,8 +0,0 @@
##############################
### TODO LIST (18/08/12) ###
##############################
1. Add ability to fetch a specific extra, rather than pull down the whole category
- This requires extra calls to MB right now, so modify 1st mb artist call to pull down the
whole album list, then only send the desried ones to importer.py
2. Update API with newstyle getExtras function (lacking entirely right now)
-359
View File
@@ -1,359 +0,0 @@
"""Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup uses a pluggable XML or HTML parser to parse a
(possibly invalid) document into a tree representation. Beautiful Soup
provides provides methods and Pythonic idioms that make it easy to
navigate, search, and modify the parse tree.
Beautiful Soup works with Python 2.6 and up. It works better if lxml
and/or html5lib is installed.
For more than you ever wanted to know about Beautiful Soup, see the
documentation:
http://www.crummy.com/software/BeautifulSoup/bs4/doc/
"""
__author__ = "Leonard Richardson (leonardr@segfault.org)"
__version__ = "4.1.3"
__copyright__ = "Copyright (c) 2004-2012 Leonard Richardson"
__license__ = "MIT"
__all__ = ['BeautifulSoup']
import re
import warnings
from .builder import builder_registry
from .dammit import UnicodeDammit
from .element import (
CData,
Comment,
DEFAULT_OUTPUT_ENCODING,
Declaration,
Doctype,
NavigableString,
PageElement,
ProcessingInstruction,
ResultSet,
SoupStrainer,
Tag,
)
# The very first thing we do is give a useful error if someone is
# running this code under Python 3 without converting it.
syntax_error = u'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work. You need to convert the code, either by installing it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).'
class BeautifulSoup(Tag):
"""
This class defines the basic interface called by the tree builders.
These methods will be called by the parser:
reset()
feed(markup)
The tree builder may call these methods from its feed() implementation:
handle_starttag(name, attrs) # See note about return value
handle_endtag(name)
handle_data(data) # Appends to the current data node
endData(containerClass=NavigableString) # Ends the current data node
No matter how complicated the underlying parser is, you should be
able to build a tree using 'start tag' events, 'end tag' events,
'data' events, and "done with data" events.
If you encounter an empty-element tag (aka a self-closing tag,
like HTML's <br> tag), call handle_starttag and then
handle_endtag.
"""
ROOT_TAG_NAME = u'[document]'
# If the end-user gives no indication which tree builder they
# want, look for one with these features.
DEFAULT_BUILDER_FEATURES = ['html', 'fast']
# Used when determining whether a text node is all whitespace and
# can be replaced with a single space. A text node that contains
# fancy Unicode spaces (usually non-breaking) should be left
# alone.
STRIP_ASCII_SPACES = {9: None, 10: None, 12: None, 13: None, 32: None, }
def __init__(self, markup="", features=None, builder=None,
parse_only=None, from_encoding=None, **kwargs):
"""The Soup object is initialized as the 'root tag', and the
provided markup (which can be a string or a file-like object)
is fed into the underlying parser."""
if 'convertEntities' in kwargs:
warnings.warn(
"BS4 does not respect the convertEntities argument to the "
"BeautifulSoup constructor. Entities are always converted "
"to Unicode characters.")
if 'markupMassage' in kwargs:
del kwargs['markupMassage']
warnings.warn(
"BS4 does not respect the markupMassage argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for any necessary markup massage.")
if 'smartQuotesTo' in kwargs:
del kwargs['smartQuotesTo']
warnings.warn(
"BS4 does not respect the smartQuotesTo argument to the "
"BeautifulSoup constructor. Smart quotes are always converted "
"to Unicode characters.")
if 'selfClosingTags' in kwargs:
del kwargs['selfClosingTags']
warnings.warn(
"BS4 does not respect the selfClosingTags argument to the "
"BeautifulSoup constructor. The tree builder is responsible "
"for understanding self-closing tags.")
if 'isHTML' in kwargs:
del kwargs['isHTML']
warnings.warn(
"BS4 does not respect the isHTML argument to the "
"BeautifulSoup constructor. You can pass in features='html' "
"or features='xml' to get a builder capable of handling "
"one or the other.")
def deprecated_argument(old_name, new_name):
if old_name in kwargs:
warnings.warn(
'The "%s" argument to the BeautifulSoup constructor '
'has been renamed to "%s."' % (old_name, new_name))
value = kwargs[old_name]
del kwargs[old_name]
return value
return None
parse_only = parse_only or deprecated_argument(
"parseOnlyThese", "parse_only")
from_encoding = from_encoding or deprecated_argument(
"fromEncoding", "from_encoding")
if len(kwargs) > 0:
arg = kwargs.keys().pop()
raise TypeError(
"__init__() got an unexpected keyword argument '%s'" % arg)
if builder is None:
if isinstance(features, basestring):
features = [features]
if features is None or len(features) == 0:
features = self.DEFAULT_BUILDER_FEATURES
builder_class = builder_registry.lookup(*features)
if builder_class is None:
raise FeatureNotFound(
"Couldn't find a tree builder with the features you "
"requested: %s. Do you need to install a parser library?"
% ",".join(features))
builder = builder_class()
self.builder = builder
self.is_xml = builder.is_xml
self.builder.soup = self
self.parse_only = parse_only
self.reset()
if hasattr(markup, 'read'): # It's a file-type object.
markup = markup.read()
(self.markup, self.original_encoding, self.declared_html_encoding,
self.contains_replacement_characters) = (
self.builder.prepare_markup(markup, from_encoding))
try:
self._feed()
except StopParsing:
pass
# Clear out the markup and remove the builder's circular
# reference to this object.
self.markup = None
self.builder.soup = None
def _feed(self):
# Convert the document to Unicode.
self.builder.reset()
self.builder.feed(self.markup)
# Close out any unfinished strings and close all the open tags.
self.endData()
while self.currentTag.name != self.ROOT_TAG_NAME:
self.popTag()
def reset(self):
Tag.__init__(self, self, self.builder, self.ROOT_TAG_NAME)
self.hidden = 1
self.builder.reset()
self.currentData = []
self.currentTag = None
self.tagStack = []
self.pushTag(self)
def new_tag(self, name, namespace=None, nsprefix=None, **attrs):
"""Create a new tag associated with this soup."""
return Tag(None, self.builder, name, namespace, nsprefix, attrs)
def new_string(self, s):
"""Create a new NavigableString associated with this soup."""
navigable = NavigableString(s)
navigable.setup()
return navigable
def insert_before(self, successor):
raise NotImplementedError("BeautifulSoup objects don't support insert_before().")
def insert_after(self, successor):
raise NotImplementedError("BeautifulSoup objects don't support insert_after().")
def popTag(self):
tag = self.tagStack.pop()
#print "Pop", tag.name
if self.tagStack:
self.currentTag = self.tagStack[-1]
return self.currentTag
def pushTag(self, tag):
#print "Push", tag.name
if self.currentTag:
self.currentTag.contents.append(tag)
self.tagStack.append(tag)
self.currentTag = self.tagStack[-1]
def endData(self, containerClass=NavigableString):
if self.currentData:
currentData = u''.join(self.currentData)
if (currentData.translate(self.STRIP_ASCII_SPACES) == '' and
not set([tag.name for tag in self.tagStack]).intersection(
self.builder.preserve_whitespace_tags)):
if '\n' in currentData:
currentData = '\n'
else:
currentData = ' '
self.currentData = []
if self.parse_only and len(self.tagStack) <= 1 and \
(not self.parse_only.text or \
not self.parse_only.search(currentData)):
return
o = containerClass(currentData)
self.object_was_parsed(o)
def object_was_parsed(self, o):
"""Add an object to the parse tree."""
o.setup(self.currentTag, self.previous_element)
if self.previous_element:
self.previous_element.next_element = o
self.previous_element = o
self.currentTag.contents.append(o)
def _popToTag(self, name, nsprefix=None, inclusivePop=True):
"""Pops the tag stack up to and including the most recent
instance of the given tag. If inclusivePop is false, pops the tag
stack up to but *not* including the most recent instqance of
the given tag."""
#print "Popping to %s" % name
if name == self.ROOT_TAG_NAME:
return
numPops = 0
mostRecentTag = None
for i in range(len(self.tagStack) - 1, 0, -1):
if (name == self.tagStack[i].name
and nsprefix == self.tagStack[i].prefix):
numPops = len(self.tagStack) - i
break
if not inclusivePop:
numPops = numPops - 1
for i in range(0, numPops):
mostRecentTag = self.popTag()
return mostRecentTag
def handle_starttag(self, name, namespace, nsprefix, attrs):
"""Push a start tag on to the stack.
If this method returns None, the tag was rejected by the
SoupStrainer. You should proceed as if the tag had not occured
in the document. For instance, if this was a self-closing tag,
don't call handle_endtag.
"""
# print "Start tag %s: %s" % (name, attrs)
self.endData()
if (self.parse_only and len(self.tagStack) <= 1
and (self.parse_only.text
or not self.parse_only.search_tag(name, attrs))):
return None
tag = Tag(self, self.builder, name, namespace, nsprefix, attrs,
self.currentTag, self.previous_element)
if tag is None:
return tag
if self.previous_element:
self.previous_element.next_element = tag
self.previous_element = tag
self.pushTag(tag)
return tag
def handle_endtag(self, name, nsprefix=None):
#print "End tag: " + name
self.endData()
self._popToTag(name, nsprefix)
def handle_data(self, data):
self.currentData.append(data)
def decode(self, pretty_print=False,
eventual_encoding=DEFAULT_OUTPUT_ENCODING,
formatter="minimal"):
"""Returns a string or Unicode representation of this document.
To get Unicode, pass None for encoding."""
if self.is_xml:
# Print the XML declaration
encoding_part = ''
if eventual_encoding != None:
encoding_part = ' encoding="%s"' % eventual_encoding
prefix = u'<?xml version="1.0"%s?>\n' % encoding_part
else:
prefix = u''
if not pretty_print:
indent_level = None
else:
indent_level = 0
return prefix + super(BeautifulSoup, self).decode(
indent_level, eventual_encoding, formatter)
class BeautifulStoneSoup(BeautifulSoup):
"""Deprecated interface to an XML parser."""
def __init__(self, *args, **kwargs):
kwargs['features'] = 'xml'
warnings.warn(
'The BeautifulStoneSoup class is deprecated. Instead of using '
'it, pass features="xml" into the BeautifulSoup constructor.')
super(BeautifulStoneSoup, self).__init__(*args, **kwargs)
class StopParsing(Exception):
pass
class FeatureNotFound(ValueError):
pass
#By default, act as an HTML pretty-printer.
if __name__ == '__main__':
import sys
soup = BeautifulSoup(sys.stdin)
print soup.prettify()
-316
View File
@@ -1,316 +0,0 @@
from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
whitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeBuilderRegistry',
]
# Some useful features for a TreeBuilder to have.
FAST = 'fast'
PERMISSIVE = 'permissive'
STRICT = 'strict'
XML = 'xml'
HTML = 'html'
HTML_5 = 'html5'
class TreeBuilderRegistry(object):
def __init__(self):
self.builders_for_feature = defaultdict(list)
self.builders = []
def register(self, treebuilder_class):
"""Register a treebuilder based on its advertised features."""
for feature in treebuilder_class.features:
self.builders_for_feature[feature].insert(0, treebuilder_class)
self.builders.insert(0, treebuilder_class)
def lookup(self, *features):
if len(self.builders) == 0:
# There are no builders at all.
return None
if len(features) == 0:
# They didn't ask for any features. Give them the most
# recently registered builder.
return self.builders[0]
# Go down the list of features in order, and eliminate any builders
# that don't match every feature.
features = list(features)
features.reverse()
candidates = None
candidate_set = None
while len(features) > 0:
feature = features.pop()
we_have_the_feature = self.builders_for_feature.get(feature, [])
if len(we_have_the_feature) > 0:
if candidates is None:
candidates = we_have_the_feature
candidate_set = set(candidates)
else:
# Eliminate any candidates that don't have this feature.
candidate_set = candidate_set.intersection(
set(we_have_the_feature))
# The only valid candidates are the ones in candidate_set.
# Go through the original list of candidates and pick the first one
# that's in candidate_set.
if candidate_set is None:
return None
for candidate in candidates:
if candidate in candidate_set:
return candidate
return None
# The BeautifulSoup class will take feature lists from developers and use them
# to look up builders in this registry.
builder_registry = TreeBuilderRegistry()
class TreeBuilder(object):
"""Turn a document into a Beautiful Soup object tree."""
features = []
is_xml = False
preserve_whitespace_tags = set()
empty_element_tags = None # A tag will be considered an empty-element
# tag when and only when it has no contents.
# A value for these tag/attribute combinations is a space- or
# comma-separated list of CDATA, rather than a single CDATA.
cdata_list_attributes = {}
def __init__(self):
self.soup = None
def reset(self):
pass
def can_be_empty_element(self, tag_name):
"""Might a tag with this name be an empty-element tag?
The final markup may or may not actually present this tag as
self-closing.
For instance: an HTMLBuilder does not consider a <p> tag to be
an empty-element tag (it's not in
HTMLBuilder.empty_element_tags). This means an empty <p> tag
will be presented as "<p></p>", not "<p />".
The default implementation has no opinion about which tags are
empty-element tags, so a tag will be presented as an
empty-element tag if and only if it has no contents.
"<foo></foo>" will become "<foo />", and "<foo>bar</foo>" will
be left alone.
"""
if self.empty_element_tags is None:
return True
return tag_name in self.empty_element_tags
def feed(self, markup):
raise NotImplementedError()
def prepare_markup(self, markup, user_specified_encoding=None,
document_declared_encoding=None):
return markup, None, None, False
def test_fragment_to_document(self, fragment):
"""Wrap an HTML fragment to make it look like a document.
Different parsers do this differently. For instance, lxml
introduces an empty <head> tag, and html5lib
doesn't. Abstracting this away lets us write simple tests
which run HTML fragments through the parser and compare the
results against other HTML fragments.
This method should not be used outside of tests.
"""
return fragment
def set_up_substitutions(self, tag):
return False
def _replace_cdata_list_attribute_values(self, tag_name, attrs):
"""Replaces class="foo bar" with class=["foo", "bar"]
Modifies its input in place.
"""
if self.cdata_list_attributes:
universal = self.cdata_list_attributes.get('*', [])
tag_specific = self.cdata_list_attributes.get(
tag_name.lower(), [])
for cdata_list_attr in itertools.chain(universal, tag_specific):
if cdata_list_attr in dict(attrs):
# Basically, we have a "class" attribute whose
# value is a whitespace-separated list of CSS
# classes. Split it into a list.
value = attrs[cdata_list_attr]
if isinstance(value, basestring):
values = whitespace_re.split(value)
else:
# html5lib sometimes calls setAttributes twice
# for the same tag when rearranging the parse
# tree. On the second call the attribute value
# here is already a list. If this happens,
# leave the value alone rather than trying to
# split it again.
values = value
attrs[cdata_list_attr] = values
return attrs
class SAXTreeBuilder(TreeBuilder):
"""A Beautiful Soup treebuilder that listens for SAX events."""
def feed(self, markup):
raise NotImplementedError()
def close(self):
pass
def startElement(self, name, attrs):
attrs = dict((key[1], value) for key, value in list(attrs.items()))
#print "Start %s, %r" % (name, attrs)
self.soup.handle_starttag(name, attrs)
def endElement(self, name):
#print "End %s" % name
self.soup.handle_endtag(name)
def startElementNS(self, nsTuple, nodeName, attrs):
# Throw away (ns, nodeName) for now.
self.startElement(nodeName, attrs)
def endElementNS(self, nsTuple, nodeName):
# Throw away (ns, nodeName) for now.
self.endElement(nodeName)
#handler.endElementNS((ns, node.nodeName), node.nodeName)
def startPrefixMapping(self, prefix, nodeValue):
# Ignore the prefix for now.
pass
def endPrefixMapping(self, prefix):
# Ignore the prefix for now.
# handler.endPrefixMapping(prefix)
pass
def characters(self, content):
self.soup.handle_data(content)
def startDocument(self):
pass
def endDocument(self):
pass
class HTMLTreeBuilder(TreeBuilder):
"""This TreeBuilder knows facts about HTML.
Such as which tags are empty-element tags.
"""
preserve_whitespace_tags = set(['pre', 'textarea'])
empty_element_tags = set(['br' , 'hr', 'input', 'img', 'meta',
'spacer', 'link', 'frame', 'base'])
# The HTML standard defines these attributes as containing a
# space-separated list of values, not a single value. That is,
# class="foo bar" means that the 'class' attribute has two values,
# 'foo' and 'bar', not the single value 'foo bar'. When we
# encounter one of these attributes, we will parse its value into
# a list of values if possible. Upon output, the list will be
# converted back into a string.
cdata_list_attributes = {
"*" : ['class', 'accesskey', 'dropzone'],
"a" : ['rel', 'rev'],
"link" : ['rel', 'rev'],
"td" : ["headers"],
"th" : ["headers"],
"td" : ["headers"],
"form" : ["accept-charset"],
"object" : ["archive"],
# These are HTML5 specific, as are *.accesskey and *.dropzone above.
"area" : ["rel"],
"icon" : ["sizes"],
"iframe" : ["sandbox"],
"output" : ["for"],
}
def set_up_substitutions(self, tag):
# We are only interested in <meta> tags
if tag.name != 'meta':
return False
http_equiv = tag.get('http-equiv')
content = tag.get('content')
charset = tag.get('charset')
# We are interested in <meta> tags that say what encoding the
# document was originally in. This means HTML 5-style <meta>
# tags that provide the "charset" attribute. It also means
# HTML 4-style <meta> tags that provide the "content"
# attribute and have "http-equiv" set to "content-type".
#
# In both cases we will replace the value of the appropriate
# attribute with a standin object that can take on any
# encoding.
meta_encoding = None
if charset is not None:
# HTML 5 style:
# <meta charset="utf8">
meta_encoding = charset
tag['charset'] = CharsetMetaAttributeValue(charset)
elif (content is not None and http_equiv is not None
and http_equiv.lower() == 'content-type'):
# HTML 4 style:
# <meta http-equiv="content-type" content="text/html; charset=utf8">
tag['content'] = ContentMetaAttributeValue(content)
return (meta_encoding is not None)
def register_treebuilders_from(module):
"""Copy TreeBuilders from the given module into this module."""
# I'm fairly sure this is not the best way to do this.
this_module = sys.modules['bs4.builder']
for name in module.__all__:
obj = getattr(module, name)
if issubclass(obj, TreeBuilder):
setattr(this_module, name, obj)
this_module.__all__.append(name)
# Register the builder while we're at it.
this_module.builder_registry.register(obj)
# Builders are registered in reverse order of priority, so that custom
# builder registrations will take precedence. In general, we want lxml
# to take precedence over html5lib, because it's faster. And we only
# want to use HTMLParser as a last result.
from . import _htmlparser
register_treebuilders_from(_htmlparser)
try:
from . import _html5lib
register_treebuilders_from(_html5lib)
except ImportError:
# They don't have html5lib installed.
pass
try:
from . import _lxml
register_treebuilders_from(_lxml)
except ImportError:
# They don't have lxml installed.
pass
-222
View File
@@ -1,222 +0,0 @@
__all__ = [
'HTML5TreeBuilder',
]
import warnings
from bs4.builder import (
PERMISSIVE,
HTML,
HTML_5,
HTMLTreeBuilder,
)
from bs4.element import NamespacedAttribute
import html5lib
from html5lib.constants import namespaces
from bs4.element import (
Comment,
Doctype,
NavigableString,
Tag,
)
class HTML5TreeBuilder(HTMLTreeBuilder):
"""Use html5lib to build a tree."""
features = ['html5lib', PERMISSIVE, HTML_5, HTML]
def prepare_markup(self, markup, user_specified_encoding):
# Store the user-specified encoding for use later on.
self.user_specified_encoding = user_specified_encoding
return markup, None, None, False
# These methods are defined by Beautiful Soup.
def feed(self, markup):
if self.soup.parse_only is not None:
warnings.warn("You provided a value for parse_only, but the html5lib tree builder doesn't support parse_only. The entire document will be parsed.")
parser = html5lib.HTMLParser(tree=self.create_treebuilder)
doc = parser.parse(markup, encoding=self.user_specified_encoding)
# Set the character encoding detected by the tokenizer.
if isinstance(markup, unicode):
# We need to special-case this because html5lib sets
# charEncoding to UTF-8 if it gets Unicode input.
doc.original_encoding = None
else:
doc.original_encoding = parser.tokenizer.stream.charEncoding[0]
def create_treebuilder(self, namespaceHTMLElements):
self.underlying_builder = TreeBuilderForHtml5lib(
self.soup, namespaceHTMLElements)
return self.underlying_builder
def test_fragment_to_document(self, fragment):
"""See `TreeBuilder`."""
return u'<html><head></head><body>%s</body></html>' % fragment
class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
def __init__(self, soup, namespaceHTMLElements):
self.soup = soup
super(TreeBuilderForHtml5lib, self).__init__(namespaceHTMLElements)
def documentClass(self):
self.soup.reset()
return Element(self.soup, self.soup, None)
def insertDoctype(self, token):
name = token["name"]
publicId = token["publicId"]
systemId = token["systemId"]
doctype = Doctype.for_name_and_ids(name, publicId, systemId)
self.soup.object_was_parsed(doctype)
def elementClass(self, name, namespace):
tag = self.soup.new_tag(name, namespace)
return Element(tag, self.soup, namespace)
def commentClass(self, data):
return TextNode(Comment(data), self.soup)
def fragmentClass(self):
self.soup = BeautifulSoup("")
self.soup.name = "[document_fragment]"
return Element(self.soup, self.soup, None)
def appendChild(self, node):
# XXX This code is not covered by the BS4 tests.
self.soup.append(node.element)
def getDocument(self):
return self.soup
def getFragment(self):
return html5lib.treebuilders._base.TreeBuilder.getFragment(self).element
class AttrList(object):
def __init__(self, element):
self.element = element
self.attrs = dict(self.element.attrs)
def __iter__(self):
return list(self.attrs.items()).__iter__()
def __setitem__(self, name, value):
"set attr", name, value
self.element[name] = value
def items(self):
return list(self.attrs.items())
def keys(self):
return list(self.attrs.keys())
def __len__(self):
return len(self.attrs)
def __getitem__(self, name):
return self.attrs[name]
def __contains__(self, name):
return name in list(self.attrs.keys())
class Element(html5lib.treebuilders._base.Node):
def __init__(self, element, soup, namespace):
html5lib.treebuilders._base.Node.__init__(self, element.name)
self.element = element
self.soup = soup
self.namespace = namespace
def appendChild(self, node):
if (node.element.__class__ == NavigableString and self.element.contents
and self.element.contents[-1].__class__ == NavigableString):
# Concatenate new text onto old text node
# XXX This has O(n^2) performance, for input like
# "a</a>a</a>a</a>..."
old_element = self.element.contents[-1]
new_element = self.soup.new_string(old_element + node.element)
old_element.replace_with(new_element)
else:
self.element.append(node.element)
node.parent = self
def getAttributes(self):
return AttrList(self.element)
def setAttributes(self, attributes):
if attributes is not None and len(attributes) > 0:
converted_attributes = []
for name, value in list(attributes.items()):
if isinstance(name, tuple):
new_name = NamespacedAttribute(*name)
del attributes[name]
attributes[new_name] = value
self.soup.builder._replace_cdata_list_attribute_values(
self.name, attributes)
for name, value in attributes.items():
self.element[name] = value
# The attributes may contain variables that need substitution.
# Call set_up_substitutions manually.
#
# The Tag constructor called this method when the Tag was created,
# but we just set/changed the attributes, so call it again.
self.soup.builder.set_up_substitutions(self.element)
attributes = property(getAttributes, setAttributes)
def insertText(self, data, insertBefore=None):
text = TextNode(self.soup.new_string(data), self.soup)
if insertBefore:
self.insertBefore(text, insertBefore)
else:
self.appendChild(text)
def insertBefore(self, node, refNode):
index = self.element.index(refNode.element)
if (node.element.__class__ == NavigableString and self.element.contents
and self.element.contents[index-1].__class__ == NavigableString):
# (See comments in appendChild)
old_node = self.element.contents[index-1]
new_str = self.soup.new_string(old_node + node.element)
old_node.replace_with(new_str)
else:
self.element.insert(index, node.element)
node.parent = self
def removeChild(self, node):
node.element.extract()
def reparentChildren(self, newParent):
while self.element.contents:
child = self.element.contents[0]
child.extract()
if isinstance(child, Tag):
newParent.appendChild(
Element(child, self.soup, namespaces["html"]))
else:
newParent.appendChild(
TextNode(child, self.soup))
def cloneNode(self):
tag = self.soup.new_tag(self.element.name, self.namespace)
node = Element(tag, self.soup, self.namespace)
for key,value in self.attributes:
node.attributes[key] = value
return node
def hasContent(self):
return self.element.contents
def getNameTuple(self):
if self.namespace == None:
return namespaces["html"], self.name
else:
return self.namespace, self.name
nameTuple = property(getNameTuple)
class TextNode(Element):
def __init__(self, element, soup):
html5lib.treebuilders._base.Node.__init__(self, None)
self.element = element
self.soup = soup
def cloneNode(self):
raise NotImplementedError
-244
View File
@@ -1,244 +0,0 @@
"""Use the HTMLParser library to parse HTML files that aren't too bad."""
__all__ = [
'HTMLParserTreeBuilder',
]
from HTMLParser import (
HTMLParser,
HTMLParseError,
)
import sys
import warnings
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument, which we'd like to set to False. Unfortunately,
# http://bugs.python.org/issue13273 makes strict=True a better bet
# before Python 3.2.3.
#
# At the end of this file, we monkeypatch HTMLParser so that
# strict=True works well on Python 3.2.2.
major, minor, release = sys.version_info[:3]
CONSTRUCTOR_TAKES_STRICT = (
major > 3
or (major == 3 and minor > 2)
or (major == 3 and minor == 2 and release >= 3))
from bs4.element import (
CData,
Comment,
Declaration,
Doctype,
ProcessingInstruction,
)
from bs4.dammit import EntitySubstitution, UnicodeDammit
from bs4.builder import (
HTML,
HTMLTreeBuilder,
STRICT,
)
HTMLPARSER = 'html.parser'
class BeautifulSoupHTMLParser(HTMLParser):
def handle_starttag(self, name, attrs):
# XXX namespace
self.soup.handle_starttag(name, None, None, dict(attrs))
def handle_endtag(self, name):
self.soup.handle_endtag(name)
def handle_data(self, data):
self.soup.handle_data(data)
def handle_charref(self, name):
# XXX workaround for a bug in HTMLParser. Remove this once
# it's fixed.
if name.startswith('x'):
real_name = int(name.lstrip('x'), 16)
else:
real_name = int(name)
try:
data = unichr(real_name)
except (ValueError, OverflowError), e:
data = u"\N{REPLACEMENT CHARACTER}"
self.handle_data(data)
def handle_entityref(self, name):
character = EntitySubstitution.HTML_ENTITY_TO_CHARACTER.get(name)
if character is not None:
data = character
else:
data = "&%s;" % name
self.handle_data(data)
def handle_comment(self, data):
self.soup.endData()
self.soup.handle_data(data)
self.soup.endData(Comment)
def handle_decl(self, data):
self.soup.endData()
if data.startswith("DOCTYPE "):
data = data[len("DOCTYPE "):]
self.soup.handle_data(data)
self.soup.endData(Doctype)
def unknown_decl(self, data):
if data.upper().startswith('CDATA['):
cls = CData
data = data[len('CDATA['):]
else:
cls = Declaration
self.soup.endData()
self.soup.handle_data(data)
self.soup.endData(cls)
def handle_pi(self, data):
self.soup.endData()
if data.endswith("?") and data.lower().startswith("xml"):
# "An XHTML processing instruction using the trailing '?'
# will cause the '?' to be included in data." - HTMLParser
# docs.
#
# Strip the question mark so we don't end up with two
# question marks.
data = data[:-1]
self.soup.handle_data(data)
self.soup.endData(ProcessingInstruction)
class HTMLParserTreeBuilder(HTMLTreeBuilder):
is_xml = False
features = [HTML, STRICT, HTMLPARSER]
def __init__(self, *args, **kwargs):
if CONSTRUCTOR_TAKES_STRICT:
kwargs['strict'] = False
self.parser_args = (args, kwargs)
def prepare_markup(self, markup, user_specified_encoding=None,
document_declared_encoding=None):
"""
:return: A 4-tuple (markup, original encoding, encoding
declared within markup, whether any characters had to be
replaced with REPLACEMENT CHARACTER).
"""
if isinstance(markup, unicode):
return markup, None, None, False
try_encodings = [user_specified_encoding, document_declared_encoding]
dammit = UnicodeDammit(markup, try_encodings, is_html=True)
return (dammit.markup, dammit.original_encoding,
dammit.declared_html_encoding,
dammit.contains_replacement_characters)
def feed(self, markup):
args, kwargs = self.parser_args
parser = BeautifulSoupHTMLParser(*args, **kwargs)
parser.soup = self.soup
try:
parser.feed(markup)
except HTMLParseError, e:
warnings.warn(RuntimeWarning(
"Python's built-in HTMLParser cannot parse the given document. This is not a bug in Beautiful Soup. The best solution is to install an external parser (lxml or html5lib), and use Beautiful Soup with that parser. See http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser for help."))
raise e
# Patch 3.2 versions of HTMLParser earlier than 3.2.3 to use some
# 3.2.3 code. This ensures they don't treat markup like <p></p> as a
# string.
#
# XXX This code can be removed once most Python 3 users are on 3.2.3.
if major == 3 and minor == 2 and not CONSTRUCTOR_TAKES_STRICT:
import re
attrfind_tolerant = re.compile(
r'\s*((?<=[\'"\s])[^\s/>][^\s/=>]*)(\s*=+\s*'
r'(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?')
HTMLParserTreeBuilder.attrfind_tolerant = attrfind_tolerant
locatestarttagend = re.compile(r"""
<[a-zA-Z][-.a-zA-Z0-9:_]* # tag name
(?:\s+ # whitespace before attribute name
(?:[a-zA-Z_][-.:a-zA-Z0-9_]* # attribute name
(?:\s*=\s* # value indicator
(?:'[^']*' # LITA-enclosed value
|\"[^\"]*\" # LIT-enclosed value
|[^'\">\s]+ # bare value
)
)?
)
)*
\s* # trailing whitespace
""", re.VERBOSE)
BeautifulSoupHTMLParser.locatestarttagend = locatestarttagend
from html.parser import tagfind, attrfind
def parse_starttag(self, i):
self.__starttag_text = None
endpos = self.check_for_whole_start_tag(i)
if endpos < 0:
return endpos
rawdata = self.rawdata
self.__starttag_text = rawdata[i:endpos]
# Now parse the data between i+1 and j into a tag and attrs
attrs = []
match = tagfind.match(rawdata, i+1)
assert match, 'unexpected call to parse_starttag()'
k = match.end()
self.lasttag = tag = rawdata[i+1:k].lower()
while k < endpos:
if self.strict:
m = attrfind.match(rawdata, k)
else:
m = attrfind_tolerant.match(rawdata, k)
if not m:
break
attrname, rest, attrvalue = m.group(1, 2, 3)
if not rest:
attrvalue = None
elif attrvalue[:1] == '\'' == attrvalue[-1:] or \
attrvalue[:1] == '"' == attrvalue[-1:]:
attrvalue = attrvalue[1:-1]
if attrvalue:
attrvalue = self.unescape(attrvalue)
attrs.append((attrname.lower(), attrvalue))
k = m.end()
end = rawdata[k:endpos].strip()
if end not in (">", "/>"):
lineno, offset = self.getpos()
if "\n" in self.__starttag_text:
lineno = lineno + self.__starttag_text.count("\n")
offset = len(self.__starttag_text) \
- self.__starttag_text.rfind("\n")
else:
offset = offset + len(self.__starttag_text)
if self.strict:
self.error("junk characters in start tag: %r"
% (rawdata[k:endpos][:20],))
self.handle_data(rawdata[i:endpos])
return endpos
if end.endswith('/>'):
# XHTML-style empty tag: <span attr="value" />
self.handle_startendtag(tag, attrs)
else:
self.handle_starttag(tag, attrs)
if tag in self.CDATA_CONTENT_ELEMENTS:
self.set_cdata_mode(tag)
return endpos
def set_cdata_mode(self, elem):
self.cdata_elem = elem.lower()
self.interesting = re.compile(r'</\s*%s\s*>' % self.cdata_elem, re.I)
BeautifulSoupHTMLParser.parse_starttag = parse_starttag
BeautifulSoupHTMLParser.set_cdata_mode = set_cdata_mode
CONSTRUCTOR_TAKES_STRICT = True
-199
View File
@@ -1,199 +0,0 @@
__all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
TreeBuilder,
XML)
from bs4.dammit import UnicodeDammit
LXML = 'lxml'
class LXMLTreeBuilderForXML(TreeBuilder):
DEFAULT_PARSER_CLASS = etree.XMLParser
is_xml = True
# Well, it's permissive by XML parser standards.
features = [LXML, XML, FAST, PERMISSIVE]
CHUNK_SIZE = 512
@property
def default_parser(self):
# This can either return a parser object or a class, which
# will be instantiated with default arguments.
return etree.XMLParser(target=self, strip_cdata=False, recover=True)
def __init__(self, parser=None, empty_element_tags=None):
if empty_element_tags is not None:
self.empty_element_tags = set(empty_element_tags)
if parser is None:
# Use the default parser.
parser = self.default_parser
if isinstance(parser, collections.Callable):
# Instantiate the parser with default arguments
parser = parser(target=self, strip_cdata=False)
self.parser = parser
self.soup = None
self.nsmaps = None
def _getNsTag(self, tag):
# Split the namespace URL out of a fully-qualified lxml tag
# name. Copied from lxml's src/lxml/sax.py.
if tag[0] == '{':
return tuple(tag[1:].split('}', 1))
else:
return (None, tag)
def prepare_markup(self, markup, user_specified_encoding=None,
document_declared_encoding=None):
"""
:return: A 3-tuple (markup, original encoding, encoding
declared within markup).
"""
if isinstance(markup, unicode):
return markup, None, None, False
try_encodings = [user_specified_encoding, document_declared_encoding]
dammit = UnicodeDammit(markup, try_encodings, is_html=True)
return (dammit.markup, dammit.original_encoding,
dammit.declared_html_encoding,
dammit.contains_replacement_characters)
def feed(self, markup):
if isinstance(markup, basestring):
markup = StringIO(markup)
# Call feed() at least once, even if the markup is empty,
# or the parser won't be initialized.
data = markup.read(self.CHUNK_SIZE)
self.parser.feed(data)
while data != '':
# Now call feed() on the rest of the data, chunk by chunk.
data = markup.read(self.CHUNK_SIZE)
if data != '':
self.parser.feed(data)
self.parser.close()
def close(self):
self.nsmaps = None
def start(self, name, attrs, nsmap={}):
# Make sure attrs is a mutable dict--lxml may send an immutable dictproxy.
attrs = dict(attrs)
nsprefix = None
# Invert each namespace map as it comes in.
if len(nsmap) == 0 and self.nsmaps != None:
# There are no new namespaces for this tag, but namespaces
# are in play, so we need a separate tag stack to know
# when they end.
self.nsmaps.append(None)
elif len(nsmap) > 0:
# A new namespace mapping has come into play.
if self.nsmaps is None:
self.nsmaps = []
inverted_nsmap = dict((value, key) for key, value in nsmap.items())
self.nsmaps.append(inverted_nsmap)
# Also treat the namespace mapping as a set of attributes on the
# tag, so we can recreate it later.
attrs = attrs.copy()
for prefix, namespace in nsmap.items():
attribute = NamespacedAttribute(
"xmlns", prefix, "http://www.w3.org/2000/xmlns/")
attrs[attribute] = namespace
if self.nsmaps is not None and len(self.nsmaps) > 0:
# Namespaces are in play. Find any attributes that came in
# from lxml with namespaces attached to their names, and
# turn then into NamespacedAttribute objects.
new_attrs = {}
for attr, value in attrs.items():
namespace, attr = self._getNsTag(attr)
if namespace is None:
new_attrs[attr] = value
else:
nsprefix = self._prefix_for_namespace(namespace)
attr = NamespacedAttribute(nsprefix, attr, namespace)
new_attrs[attr] = value
attrs = new_attrs
namespace, name = self._getNsTag(name)
nsprefix = self._prefix_for_namespace(namespace)
self.soup.handle_starttag(name, namespace, nsprefix, attrs)
def _prefix_for_namespace(self, namespace):
"""Find the currently active prefix for the given namespace."""
if namespace is None:
return None
for inverted_nsmap in reversed(self.nsmaps):
if inverted_nsmap is not None and namespace in inverted_nsmap:
return inverted_nsmap[namespace]
def end(self, name):
self.soup.endData()
completed_tag = self.soup.tagStack[-1]
namespace, name = self._getNsTag(name)
nsprefix = None
if namespace is not None:
for inverted_nsmap in reversed(self.nsmaps):
if inverted_nsmap is not None and namespace in inverted_nsmap:
nsprefix = inverted_nsmap[namespace]
break
self.soup.handle_endtag(name, nsprefix)
if self.nsmaps != None:
# This tag, or one of its parents, introduced a namespace
# mapping, so pop it off the stack.
self.nsmaps.pop()
if len(self.nsmaps) == 0:
# Namespaces are no longer in play, so don't bother keeping
# track of the namespace stack.
self.nsmaps = None
def pi(self, target, data):
pass
def data(self, content):
self.soup.handle_data(content)
def doctype(self, name, pubid, system):
self.soup.endData()
doctype = Doctype.for_name_and_ids(name, pubid, system)
self.soup.object_was_parsed(doctype)
def comment(self, content):
"Handle comments as Comment objects."
self.soup.endData()
self.soup.handle_data(content)
self.soup.endData(Comment)
def test_fragment_to_document(self, fragment):
"""See `TreeBuilder`."""
return u'<?xml version="1.0" encoding="utf-8"?>\n%s' % fragment
class LXMLTreeBuilder(HTMLTreeBuilder, LXMLTreeBuilderForXML):
features = [LXML, HTML, FAST, PERMISSIVE]
is_xml = False
@property
def default_parser(self):
return etree.HTMLParser
def feed(self, markup):
self.parser.feed(markup)
self.parser.close()
def test_fragment_to_document(self, fragment):
"""See `TreeBuilder`."""
return u'<html><body>%s</body></html>' % fragment
-803
View File
@@ -1,803 +0,0 @@
# -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This class forces XML data into a standard format (usually to UTF-8 or
Unicode). It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It does not rewrite the XML or HTML to reflect a new
encoding; that's the tree builder's job.
"""
import codecs
from htmlentitydefs import codepoint2name
import re
import logging
# Import a library to autodetect character encodings.
chardet_type = None
try:
# First try the fast C implementation.
# PyPI package: cchardet
import cchardet
def chardet_dammit(s):
return cchardet.detect(s)['encoding']
except ImportError:
try:
# Fall back to the pure Python implementation
# Debian package: python-chardet
# PyPI package: chardet
import chardet
def chardet_dammit(s):
return chardet.detect(s)['encoding']
#import chardet.constants
#chardet.constants._debug = 1
except ImportError:
# No chardet available.
def chardet_dammit(s):
return None
# Available from http://cjkpython.i18n.org/.
try:
import iconv_codec
except ImportError:
pass
xml_encoding_re = re.compile(
'^<\?.*encoding=[\'"](.*?)[\'"].*\?>'.encode(), re.I)
html_meta_re = re.compile(
'<\s*meta[^>]+charset\s*=\s*["\']?([^>]*?)[ /;\'">]'.encode(), re.I)
class EntitySubstitution(object):
"""Substitute XML or HTML entities for the corresponding characters."""
def _populate_class_variables():
lookup = {}
reverse_lookup = {}
characters_for_re = []
for codepoint, name in list(codepoint2name.items()):
character = unichr(codepoint)
if codepoint != 34:
# There's no point in turning the quotation mark into
# &quot;, unless it happens within an attribute value, which
# is handled elsewhere.
characters_for_re.append(character)
lookup[character] = name
# But we do want to turn &quot; into the quotation mark.
reverse_lookup[name] = character
re_definition = "[%s]" % "".join(characters_for_re)
return lookup, reverse_lookup, re.compile(re_definition)
(CHARACTER_TO_HTML_ENTITY, HTML_ENTITY_TO_CHARACTER,
CHARACTER_TO_HTML_ENTITY_RE) = _populate_class_variables()
CHARACTER_TO_XML_ENTITY = {
"'": "apos",
'"': "quot",
"&": "amp",
"<": "lt",
">": "gt",
}
BARE_AMPERSAND_OR_BRACKET = re.compile("([<>]|"
"&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;)"
")")
@classmethod
def _substitute_html_entity(cls, matchobj):
entity = cls.CHARACTER_TO_HTML_ENTITY.get(matchobj.group(0))
return "&%s;" % entity
@classmethod
def _substitute_xml_entity(cls, matchobj):
"""Used with a regular expression to substitute the
appropriate XML entity for an XML special character."""
entity = cls.CHARACTER_TO_XML_ENTITY[matchobj.group(0)]
return "&%s;" % entity
@classmethod
def quoted_attribute_value(self, value):
"""Make a value into a quoted XML attribute, possibly escaping it.
Most strings will be quoted using double quotes.
Bob's Bar -> "Bob's Bar"
If a string contains double quotes, it will be quoted using
single quotes.
Welcome to "my bar" -> 'Welcome to "my bar"'
If a string contains both single and double quotes, the
double quotes will be escaped, and the string will be quoted
using double quotes.
Welcome to "Bob's Bar" -> "Welcome to &quot;Bob's bar&quot;
"""
quote_with = '"'
if '"' in value:
if "'" in value:
# The string contains both single and double
# quotes. Turn the double quotes into
# entities. We quote the double quotes rather than
# the single quotes because the entity name is
# "&quot;" whether this is HTML or XML. If we
# quoted the single quotes, we'd have to decide
# between &apos; and &squot;.
replace_with = "&quot;"
value = value.replace('"', replace_with)
else:
# There are double quotes but no single quotes.
# We can use single quotes to quote the attribute.
quote_with = "'"
return quote_with + value + quote_with
@classmethod
def substitute_xml(cls, value, make_quoted_attribute=False):
"""Substitute XML entities for special XML characters.
:param value: A string to be substituted. The less-than sign will
become &lt;, the greater-than sign will become &gt;, and any
ampersands that are not part of an entity defition will
become &amp;.
:param make_quoted_attribute: If True, then the string will be
quoted, as befits an attribute value.
"""
# Escape angle brackets, and ampersands that aren't part of
# entities.
value = cls.BARE_AMPERSAND_OR_BRACKET.sub(
cls._substitute_xml_entity, value)
if make_quoted_attribute:
value = cls.quoted_attribute_value(value)
return value
@classmethod
def substitute_html(cls, s):
"""Replace certain Unicode characters with named HTML entities.
This differs from data.encode(encoding, 'xmlcharrefreplace')
in that the goal is to make the result more readable (to those
with ASCII displays) rather than to recover from
errors. There's absolutely nothing wrong with a UTF-8 string
containg a LATIN SMALL LETTER E WITH ACUTE, but replacing that
character with "&eacute;" will make it more readable to some
people.
"""
return cls.CHARACTER_TO_HTML_ENTITY_RE.sub(
cls._substitute_html_entity, s)
class UnicodeDammit:
"""A class for detecting the encoding of a *ML document and
converting it to a Unicode string. If the source encoding is
windows-1252, can replace MS smart quotes with their HTML or XML
equivalents."""
# This dictionary maps commonly seen values for "charset" in HTML
# meta tags to the corresponding Python codec names. It only covers
# values that aren't in Python's aliases and can't be determined
# by the heuristics in find_codec.
CHARSET_ALIASES = {"macintosh": "mac-roman",
"x-sjis": "shift-jis"}
ENCODINGS_WITH_SMART_QUOTES = [
"windows-1252",
"iso-8859-1",
"iso-8859-2",
]
def __init__(self, markup, override_encodings=[],
smart_quotes_to=None, is_html=False):
self.declared_html_encoding = None
self.smart_quotes_to = smart_quotes_to
self.tried_encodings = []
self.contains_replacement_characters = False
if markup == '' or isinstance(markup, unicode):
self.markup = markup
self.unicode_markup = unicode(markup)
self.original_encoding = None
return
new_markup, document_encoding, sniffed_encoding = \
self._detectEncoding(markup, is_html)
self.markup = new_markup
u = None
if new_markup != markup:
# _detectEncoding modified the markup, then converted it to
# Unicode and then to UTF-8. So convert it from UTF-8.
u = self._convert_from("utf8")
self.original_encoding = sniffed_encoding
if not u:
for proposed_encoding in (
override_encodings + [document_encoding, sniffed_encoding]):
if proposed_encoding is not None:
u = self._convert_from(proposed_encoding)
if u:
break
# If no luck and we have auto-detection library, try that:
if not u and not isinstance(self.markup, unicode):
u = self._convert_from(chardet_dammit(self.markup))
# As a last resort, try utf-8 and windows-1252:
if not u:
for proposed_encoding in ("utf-8", "windows-1252"):
u = self._convert_from(proposed_encoding)
if u:
break
# As an absolute last resort, try the encodings again with
# character replacement.
if not u:
for proposed_encoding in (
override_encodings + [
document_encoding, sniffed_encoding, "utf-8", "windows-1252"]):
if proposed_encoding != "ascii":
u = self._convert_from(proposed_encoding, "replace")
if u is not None:
logging.warning(
"Some characters could not be decoded, and were "
"replaced with REPLACEMENT CHARACTER.")
self.contains_replacement_characters = True
break
# We could at this point force it to ASCII, but that would
# destroy so much data that I think giving up is better
self.unicode_markup = u
if not u:
self.original_encoding = None
def _sub_ms_char(self, match):
"""Changes a MS smart quote character to an XML or HTML
entity, or an ASCII character."""
orig = match.group(1)
if self.smart_quotes_to == 'ascii':
sub = self.MS_CHARS_TO_ASCII.get(orig).encode()
else:
sub = self.MS_CHARS.get(orig)
if type(sub) == tuple:
if self.smart_quotes_to == 'xml':
sub = '&#x'.encode() + sub[1].encode() + ';'.encode()
else:
sub = '&'.encode() + sub[0].encode() + ';'.encode()
else:
sub = sub.encode()
return sub
def _convert_from(self, proposed, errors="strict"):
proposed = self.find_codec(proposed)
if not proposed or (proposed, errors) in self.tried_encodings:
return None
self.tried_encodings.append((proposed, errors))
markup = self.markup
# Convert smart quotes to HTML if coming from an encoding
# that might have them.
if (self.smart_quotes_to is not None
and proposed.lower() in self.ENCODINGS_WITH_SMART_QUOTES):
smart_quotes_re = b"([\x80-\x9f])"
smart_quotes_compiled = re.compile(smart_quotes_re)
markup = smart_quotes_compiled.sub(self._sub_ms_char, markup)
try:
#print "Trying to convert document to %s (errors=%s)" % (
# proposed, errors)
u = self._to_unicode(markup, proposed, errors)
self.markup = u
self.original_encoding = proposed
except Exception as e:
#print "That didn't work!"
#print e
return None
#print "Correct encoding: %s" % proposed
return self.markup
def _to_unicode(self, data, encoding, errors="strict"):
'''Given a string and its encoding, decodes the string into Unicode.
%encoding is a string recognized by encodings.aliases'''
# strip Byte Order Mark (if present)
if (len(data) >= 4) and (data[:2] == '\xfe\xff') \
and (data[2:4] != '\x00\x00'):
encoding = 'utf-16be'
data = data[2:]
elif (len(data) >= 4) and (data[:2] == '\xff\xfe') \
and (data[2:4] != '\x00\x00'):
encoding = 'utf-16le'
data = data[2:]
elif data[:3] == '\xef\xbb\xbf':
encoding = 'utf-8'
data = data[3:]
elif data[:4] == '\x00\x00\xfe\xff':
encoding = 'utf-32be'
data = data[4:]
elif data[:4] == '\xff\xfe\x00\x00':
encoding = 'utf-32le'
data = data[4:]
newdata = unicode(data, encoding, errors)
return newdata
def _detectEncoding(self, xml_data, is_html=False):
"""Given a document, tries to detect its XML encoding."""
xml_encoding = sniffed_xml_encoding = None
try:
if xml_data[:4] == b'\x4c\x6f\xa7\x94':
# EBCDIC
xml_data = self._ebcdic_to_ascii(xml_data)
elif xml_data[:4] == b'\x00\x3c\x00\x3f':
# UTF-16BE
sniffed_xml_encoding = 'utf-16be'
xml_data = unicode(xml_data, 'utf-16be').encode('utf-8')
elif (len(xml_data) >= 4) and (xml_data[:2] == b'\xfe\xff') \
and (xml_data[2:4] != b'\x00\x00'):
# UTF-16BE with BOM
sniffed_xml_encoding = 'utf-16be'
xml_data = unicode(xml_data[2:], 'utf-16be').encode('utf-8')
elif xml_data[:4] == b'\x3c\x00\x3f\x00':
# UTF-16LE
sniffed_xml_encoding = 'utf-16le'
xml_data = unicode(xml_data, 'utf-16le').encode('utf-8')
elif (len(xml_data) >= 4) and (xml_data[:2] == b'\xff\xfe') and \
(xml_data[2:4] != b'\x00\x00'):
# UTF-16LE with BOM
sniffed_xml_encoding = 'utf-16le'
xml_data = unicode(xml_data[2:], 'utf-16le').encode('utf-8')
elif xml_data[:4] == b'\x00\x00\x00\x3c':
# UTF-32BE
sniffed_xml_encoding = 'utf-32be'
xml_data = unicode(xml_data, 'utf-32be').encode('utf-8')
elif xml_data[:4] == b'\x3c\x00\x00\x00':
# UTF-32LE
sniffed_xml_encoding = 'utf-32le'
xml_data = unicode(xml_data, 'utf-32le').encode('utf-8')
elif xml_data[:4] == b'\x00\x00\xfe\xff':
# UTF-32BE with BOM
sniffed_xml_encoding = 'utf-32be'
xml_data = unicode(xml_data[4:], 'utf-32be').encode('utf-8')
elif xml_data[:4] == b'\xff\xfe\x00\x00':
# UTF-32LE with BOM
sniffed_xml_encoding = 'utf-32le'
xml_data = unicode(xml_data[4:], 'utf-32le').encode('utf-8')
elif xml_data[:3] == b'\xef\xbb\xbf':
# UTF-8 with BOM
sniffed_xml_encoding = 'utf-8'
xml_data = unicode(xml_data[3:], 'utf-8').encode('utf-8')
else:
sniffed_xml_encoding = 'ascii'
pass
except:
xml_encoding_match = None
xml_encoding_match = xml_encoding_re.match(xml_data)
if not xml_encoding_match and is_html:
xml_encoding_match = html_meta_re.search(xml_data)
if xml_encoding_match is not None:
xml_encoding = xml_encoding_match.groups()[0].decode(
'ascii').lower()
if is_html:
self.declared_html_encoding = xml_encoding
if sniffed_xml_encoding and \
(xml_encoding in ('iso-10646-ucs-2', 'ucs-2', 'csunicode',
'iso-10646-ucs-4', 'ucs-4', 'csucs4',
'utf-16', 'utf-32', 'utf_16', 'utf_32',
'utf16', 'u16')):
xml_encoding = sniffed_xml_encoding
return xml_data, xml_encoding, sniffed_xml_encoding
def find_codec(self, charset):
return self._codec(self.CHARSET_ALIASES.get(charset, charset)) \
or (charset and self._codec(charset.replace("-", ""))) \
or (charset and self._codec(charset.replace("-", "_"))) \
or charset
def _codec(self, charset):
if not charset:
return charset
codec = None
try:
codecs.lookup(charset)
codec = charset
except (LookupError, ValueError):
pass
return codec
EBCDIC_TO_ASCII_MAP = None
def _ebcdic_to_ascii(self, s):
c = self.__class__
if not c.EBCDIC_TO_ASCII_MAP:
emap = (0,1,2,3,156,9,134,127,151,141,142,11,12,13,14,15,
16,17,18,19,157,133,8,135,24,25,146,143,28,29,30,31,
128,129,130,131,132,10,23,27,136,137,138,139,140,5,6,7,
144,145,22,147,148,149,150,4,152,153,154,155,20,21,158,26,
32,160,161,162,163,164,165,166,167,168,91,46,60,40,43,33,
38,169,170,171,172,173,174,175,176,177,93,36,42,41,59,94,
45,47,178,179,180,181,182,183,184,185,124,44,37,95,62,63,
186,187,188,189,190,191,192,193,194,96,58,35,64,39,61,34,
195,97,98,99,100,101,102,103,104,105,196,197,198,199,200,
201,202,106,107,108,109,110,111,112,113,114,203,204,205,
206,207,208,209,126,115,116,117,118,119,120,121,122,210,
211,212,213,214,215,216,217,218,219,220,221,222,223,224,
225,226,227,228,229,230,231,123,65,66,67,68,69,70,71,72,
73,232,233,234,235,236,237,125,74,75,76,77,78,79,80,81,
82,238,239,240,241,242,243,92,159,83,84,85,86,87,88,89,
90,244,245,246,247,248,249,48,49,50,51,52,53,54,55,56,57,
250,251,252,253,254,255)
import string
c.EBCDIC_TO_ASCII_MAP = string.maketrans(
''.join(map(chr, list(range(256)))), ''.join(map(chr, emap)))
return s.translate(c.EBCDIC_TO_ASCII_MAP)
# A partial mapping of ISO-Latin-1 to HTML entities/XML numeric entities.
MS_CHARS = {b'\x80': ('euro', '20AC'),
b'\x81': ' ',
b'\x82': ('sbquo', '201A'),
b'\x83': ('fnof', '192'),
b'\x84': ('bdquo', '201E'),
b'\x85': ('hellip', '2026'),
b'\x86': ('dagger', '2020'),
b'\x87': ('Dagger', '2021'),
b'\x88': ('circ', '2C6'),
b'\x89': ('permil', '2030'),
b'\x8A': ('Scaron', '160'),
b'\x8B': ('lsaquo', '2039'),
b'\x8C': ('OElig', '152'),
b'\x8D': '?',
b'\x8E': ('#x17D', '17D'),
b'\x8F': '?',
b'\x90': '?',
b'\x91': ('lsquo', '2018'),
b'\x92': ('rsquo', '2019'),
b'\x93': ('ldquo', '201C'),
b'\x94': ('rdquo', '201D'),
b'\x95': ('bull', '2022'),
b'\x96': ('ndash', '2013'),
b'\x97': ('mdash', '2014'),
b'\x98': ('tilde', '2DC'),
b'\x99': ('trade', '2122'),
b'\x9a': ('scaron', '161'),
b'\x9b': ('rsaquo', '203A'),
b'\x9c': ('oelig', '153'),
b'\x9d': '?',
b'\x9e': ('#x17E', '17E'),
b'\x9f': ('Yuml', ''),}
# A parochial partial mapping of ISO-Latin-1 to ASCII. Contains
# horrors like stripping diacritical marks to turn á into a, but also
# contains non-horrors like turning “ into ".
MS_CHARS_TO_ASCII = {
b'\x80' : 'EUR',
b'\x81' : ' ',
b'\x82' : ',',
b'\x83' : 'f',
b'\x84' : ',,',
b'\x85' : '...',
b'\x86' : '+',
b'\x87' : '++',
b'\x88' : '^',
b'\x89' : '%',
b'\x8a' : 'S',
b'\x8b' : '<',
b'\x8c' : 'OE',
b'\x8d' : '?',
b'\x8e' : 'Z',
b'\x8f' : '?',
b'\x90' : '?',
b'\x91' : "'",
b'\x92' : "'",
b'\x93' : '"',
b'\x94' : '"',
b'\x95' : '*',
b'\x96' : '-',
b'\x97' : '--',
b'\x98' : '~',
b'\x99' : '(TM)',
b'\x9a' : 's',
b'\x9b' : '>',
b'\x9c' : 'oe',
b'\x9d' : '?',
b'\x9e' : 'z',
b'\x9f' : 'Y',
b'\xa0' : ' ',
b'\xa1' : '!',
b'\xa2' : 'c',
b'\xa3' : 'GBP',
b'\xa4' : '$', #This approximation is especially parochial--this is the
#generic currency symbol.
b'\xa5' : 'YEN',
b'\xa6' : '|',
b'\xa7' : 'S',
b'\xa8' : '..',
b'\xa9' : '',
b'\xaa' : '(th)',
b'\xab' : '<<',
b'\xac' : '!',
b'\xad' : ' ',
b'\xae' : '(R)',
b'\xaf' : '-',
b'\xb0' : 'o',
b'\xb1' : '+-',
b'\xb2' : '2',
b'\xb3' : '3',
b'\xb4' : ("'", 'acute'),
b'\xb5' : 'u',
b'\xb6' : 'P',
b'\xb7' : '*',
b'\xb8' : ',',
b'\xb9' : '1',
b'\xba' : '(th)',
b'\xbb' : '>>',
b'\xbc' : '1/4',
b'\xbd' : '1/2',
b'\xbe' : '3/4',
b'\xbf' : '?',
b'\xc0' : 'A',
b'\xc1' : 'A',
b'\xc2' : 'A',
b'\xc3' : 'A',
b'\xc4' : 'A',
b'\xc5' : 'A',
b'\xc6' : 'AE',
b'\xc7' : 'C',
b'\xc8' : 'E',
b'\xc9' : 'E',
b'\xca' : 'E',
b'\xcb' : 'E',
b'\xcc' : 'I',
b'\xcd' : 'I',
b'\xce' : 'I',
b'\xcf' : 'I',
b'\xd0' : 'D',
b'\xd1' : 'N',
b'\xd2' : 'O',
b'\xd3' : 'O',
b'\xd4' : 'O',
b'\xd5' : 'O',
b'\xd6' : 'O',
b'\xd7' : '*',
b'\xd8' : 'O',
b'\xd9' : 'U',
b'\xda' : 'U',
b'\xdb' : 'U',
b'\xdc' : 'U',
b'\xdd' : 'Y',
b'\xde' : 'b',
b'\xdf' : 'B',
b'\xe0' : 'a',
b'\xe1' : 'a',
b'\xe2' : 'a',
b'\xe3' : 'a',
b'\xe4' : 'a',
b'\xe5' : 'a',
b'\xe6' : 'ae',
b'\xe7' : 'c',
b'\xe8' : 'e',
b'\xe9' : 'e',
b'\xea' : 'e',
b'\xeb' : 'e',
b'\xec' : 'i',
b'\xed' : 'i',
b'\xee' : 'i',
b'\xef' : 'i',
b'\xf0' : 'o',
b'\xf1' : 'n',
b'\xf2' : 'o',
b'\xf3' : 'o',
b'\xf4' : 'o',
b'\xf5' : 'o',
b'\xf6' : 'o',
b'\xf7' : '/',
b'\xf8' : 'o',
b'\xf9' : 'u',
b'\xfa' : 'u',
b'\xfb' : 'u',
b'\xfc' : 'u',
b'\xfd' : 'y',
b'\xfe' : 'b',
b'\xff' : 'y',
}
# A map used when removing rogue Windows-1252/ISO-8859-1
# characters in otherwise UTF-8 documents.
#
# Note that \x81, \x8d, \x8f, \x90, and \x9d are undefined in
# Windows-1252.
WINDOWS_1252_TO_UTF8 = {
0x80 : b'\xe2\x82\xac', # €
0x82 : b'\xe2\x80\x9a', #
0x83 : b'\xc6\x92', # ƒ
0x84 : b'\xe2\x80\x9e', # „
0x85 : b'\xe2\x80\xa6', # …
0x86 : b'\xe2\x80\xa0', # †
0x87 : b'\xe2\x80\xa1', # ‡
0x88 : b'\xcb\x86', # ˆ
0x89 : b'\xe2\x80\xb0', # ‰
0x8a : b'\xc5\xa0', # Š
0x8b : b'\xe2\x80\xb9', #
0x8c : b'\xc5\x92', # Œ
0x8e : b'\xc5\xbd', # Ž
0x91 : b'\xe2\x80\x98', #
0x92 : b'\xe2\x80\x99', #
0x93 : b'\xe2\x80\x9c', # “
0x94 : b'\xe2\x80\x9d', # ”
0x95 : b'\xe2\x80\xa2', # •
0x96 : b'\xe2\x80\x93', #
0x97 : b'\xe2\x80\x94', # —
0x98 : b'\xcb\x9c', # ˜
0x99 : b'\xe2\x84\xa2', # ™
0x9a : b'\xc5\xa1', # š
0x9b : b'\xe2\x80\xba', #
0x9c : b'\xc5\x93', # œ
0x9e : b'\xc5\xbe', # ž
0x9f : b'\xc5\xb8', # Ÿ
0xa0 : b'\xc2\xa0', #  
0xa1 : b'\xc2\xa1', # ¡
0xa2 : b'\xc2\xa2', # ¢
0xa3 : b'\xc2\xa3', # £
0xa4 : b'\xc2\xa4', # ¤
0xa5 : b'\xc2\xa5', # ¥
0xa6 : b'\xc2\xa6', # ¦
0xa7 : b'\xc2\xa7', # §
0xa8 : b'\xc2\xa8', # ¨
0xa9 : b'\xc2\xa9', # ©
0xaa : b'\xc2\xaa', # ª
0xab : b'\xc2\xab', # «
0xac : b'\xc2\xac', # ¬
0xad : b'\xc2\xad', # ­
0xae : b'\xc2\xae', # ®
0xaf : b'\xc2\xaf', # ¯
0xb0 : b'\xc2\xb0', # °
0xb1 : b'\xc2\xb1', # ±
0xb2 : b'\xc2\xb2', # ²
0xb3 : b'\xc2\xb3', # ³
0xb4 : b'\xc2\xb4', # ´
0xb5 : b'\xc2\xb5', # µ
0xb6 : b'\xc2\xb6', # ¶
0xb7 : b'\xc2\xb7', # ·
0xb8 : b'\xc2\xb8', # ¸
0xb9 : b'\xc2\xb9', # ¹
0xba : b'\xc2\xba', # º
0xbb : b'\xc2\xbb', # »
0xbc : b'\xc2\xbc', # ¼
0xbd : b'\xc2\xbd', # ½
0xbe : b'\xc2\xbe', # ¾
0xbf : b'\xc2\xbf', # ¿
0xc0 : b'\xc3\x80', # À
0xc1 : b'\xc3\x81', # Á
0xc2 : b'\xc3\x82', # Â
0xc3 : b'\xc3\x83', # Ã
0xc4 : b'\xc3\x84', # Ä
0xc5 : b'\xc3\x85', # Å
0xc6 : b'\xc3\x86', # Æ
0xc7 : b'\xc3\x87', # Ç
0xc8 : b'\xc3\x88', # È
0xc9 : b'\xc3\x89', # É
0xca : b'\xc3\x8a', # Ê
0xcb : b'\xc3\x8b', # Ë
0xcc : b'\xc3\x8c', # Ì
0xcd : b'\xc3\x8d', # Í
0xce : b'\xc3\x8e', # Î
0xcf : b'\xc3\x8f', # Ï
0xd0 : b'\xc3\x90', # Ð
0xd1 : b'\xc3\x91', # Ñ
0xd2 : b'\xc3\x92', # Ò
0xd3 : b'\xc3\x93', # Ó
0xd4 : b'\xc3\x94', # Ô
0xd5 : b'\xc3\x95', # Õ
0xd6 : b'\xc3\x96', # Ö
0xd7 : b'\xc3\x97', # ×
0xd8 : b'\xc3\x98', # Ø
0xd9 : b'\xc3\x99', # Ù
0xda : b'\xc3\x9a', # Ú
0xdb : b'\xc3\x9b', # Û
0xdc : b'\xc3\x9c', # Ü
0xdd : b'\xc3\x9d', # Ý
0xde : b'\xc3\x9e', # Þ
0xdf : b'\xc3\x9f', # ß
0xe0 : b'\xc3\xa0', # à
0xe1 : b'\xa1', # á
0xe2 : b'\xc3\xa2', # â
0xe3 : b'\xc3\xa3', # ã
0xe4 : b'\xc3\xa4', # ä
0xe5 : b'\xc3\xa5', # å
0xe6 : b'\xc3\xa6', # æ
0xe7 : b'\xc3\xa7', # ç
0xe8 : b'\xc3\xa8', # è
0xe9 : b'\xc3\xa9', # é
0xea : b'\xc3\xaa', # ê
0xeb : b'\xc3\xab', # ë
0xec : b'\xc3\xac', # ì
0xed : b'\xc3\xad', # í
0xee : b'\xc3\xae', # î
0xef : b'\xc3\xaf', # ï
0xf0 : b'\xc3\xb0', # ð
0xf1 : b'\xc3\xb1', # ñ
0xf2 : b'\xc3\xb2', # ò
0xf3 : b'\xc3\xb3', # ó
0xf4 : b'\xc3\xb4', # ô
0xf5 : b'\xc3\xb5', # õ
0xf6 : b'\xc3\xb6', # ö
0xf7 : b'\xc3\xb7', # ÷
0xf8 : b'\xc3\xb8', # ø
0xf9 : b'\xc3\xb9', # ù
0xfa : b'\xc3\xba', # ú
0xfb : b'\xc3\xbb', # û
0xfc : b'\xc3\xbc', # ü
0xfd : b'\xc3\xbd', # ý
0xfe : b'\xc3\xbe', # þ
}
MULTIBYTE_MARKERS_AND_SIZES = [
(0xc2, 0xdf, 2), # 2-byte characters start with a byte C2-DF
(0xe0, 0xef, 3), # 3-byte characters start with E0-EF
(0xf0, 0xf4, 4), # 4-byte characters start with F0-F4
]
FIRST_MULTIBYTE_MARKER = MULTIBYTE_MARKERS_AND_SIZES[0][0]
LAST_MULTIBYTE_MARKER = MULTIBYTE_MARKERS_AND_SIZES[-1][1]
@classmethod
def detwingle(cls, in_bytes, main_encoding="utf8",
embedded_encoding="windows-1252"):
"""Fix characters from one encoding embedded in some other encoding.
Currently the only situation supported is Windows-1252 (or its
subset ISO-8859-1), embedded in UTF-8.
The input must be a bytestring. If you've already converted
the document to Unicode, you're too late.
The output is a bytestring in which `embedded_encoding`
characters have been converted to their `main_encoding`
equivalents.
"""
if embedded_encoding.replace('_', '-').lower() not in (
'windows-1252', 'windows_1252'):
raise NotImplementedError(
"Windows-1252 and ISO-8859-1 are the only currently supported "
"embedded encodings.")
if main_encoding.lower() not in ('utf8', 'utf-8'):
raise NotImplementedError(
"UTF-8 is the only currently supported main encoding.")
byte_chunks = []
chunk_start = 0
pos = 0
while pos < len(in_bytes):
byte = in_bytes[pos]
if not isinstance(byte, int):
# Python 2.x
byte = ord(byte)
if (byte >= cls.FIRST_MULTIBYTE_MARKER
and byte <= cls.LAST_MULTIBYTE_MARKER):
# This is the start of a UTF-8 multibyte character. Skip
# to the end.
for start, end, size in cls.MULTIBYTE_MARKERS_AND_SIZES:
if byte >= start and byte <= end:
pos += size
break
elif byte >= 0x80 and byte in cls.WINDOWS_1252_TO_UTF8:
# We found a Windows-1252 character!
# Save the string up to this point as a chunk.
byte_chunks.append(in_bytes[chunk_start:pos])
# Now translate the Windows-1252 character into UTF-8
# and add it as another, one-byte chunk.
byte_chunks.append(cls.WINDOWS_1252_TO_UTF8[byte])
pos += 1
chunk_start = pos
else:
# Go on to the next character.
pos += 1
if chunk_start == 0:
# The string is unchanged.
return in_bytes
else:
# Store the final chunk.
byte_chunks.append(in_bytes[chunk_start:])
return b''.join(byte_chunks)
-1355
View File
File diff suppressed because it is too large Load Diff
-537
View File
@@ -1,537 +0,0 @@
"""Helper classes for tests."""
import copy
import functools
import unittest
from unittest import TestCase
from bs4 import BeautifulSoup
from bs4.element import (
CharsetMetaAttributeValue,
Comment,
ContentMetaAttributeValue,
Doctype,
SoupStrainer,
)
from bs4.builder import HTMLParserTreeBuilder
default_builder = HTMLParserTreeBuilder
class SoupTest(unittest.TestCase):
@property
def default_builder(self):
return default_builder()
def soup(self, markup, **kwargs):
"""Build a Beautiful Soup object from markup."""
builder = kwargs.pop('builder', self.default_builder)
return BeautifulSoup(markup, builder=builder, **kwargs)
def document_for(self, markup):
"""Turn an HTML fragment into a document.
The details depend on the builder.
"""
return self.default_builder.test_fragment_to_document(markup)
def assertSoupEquals(self, to_parse, compare_parsed_to=None):
builder = self.default_builder
obj = BeautifulSoup(to_parse, builder=builder)
if compare_parsed_to is None:
compare_parsed_to = to_parse
self.assertEqual(obj.decode(), self.document_for(compare_parsed_to))
class HTMLTreeBuilderSmokeTest(object):
"""A basic test of a treebuilder's competence.
Any HTML treebuilder, present or future, should be able to pass
these tests. With invalid markup, there's room for interpretation,
and different parsers can handle it differently. But with the
markup in these tests, there's not much room for interpretation.
"""
def assertDoctypeHandled(self, doctype_fragment):
"""Assert that a given doctype string is handled correctly."""
doctype_str, soup = self._document_with_doctype(doctype_fragment)
# Make sure a Doctype object was created.
doctype = soup.contents[0]
self.assertEqual(doctype.__class__, Doctype)
self.assertEqual(doctype, doctype_fragment)
self.assertEqual(str(soup)[:len(doctype_str)], doctype_str)
# Make sure that the doctype was correctly associated with the
# parse tree and that the rest of the document parsed.
self.assertEqual(soup.p.contents[0], 'foo')
def _document_with_doctype(self, doctype_fragment):
"""Generate and parse a document with the given doctype."""
doctype = '<!DOCTYPE %s>' % doctype_fragment
markup = doctype + '\n<p>foo</p>'
soup = self.soup(markup)
return doctype, soup
def test_normal_doctypes(self):
"""Make sure normal, everyday HTML doctypes are handled correctly."""
self.assertDoctypeHandled("html")
self.assertDoctypeHandled(
'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"')
def test_public_doctype_with_url(self):
doctype = 'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"'
self.assertDoctypeHandled(doctype)
def test_system_doctype(self):
self.assertDoctypeHandled('foo SYSTEM "http://www.example.com/"')
def test_namespaced_system_doctype(self):
# We can handle a namespaced doctype with a system ID.
self.assertDoctypeHandled('xsl:stylesheet SYSTEM "htmlent.dtd"')
def test_namespaced_public_doctype(self):
# Test a namespaced doctype with a public id.
self.assertDoctypeHandled('xsl:stylesheet PUBLIC "htmlent.dtd"')
def test_real_xhtml_document(self):
"""A real XHTML document should come out more or less the same as it went in."""
markup = b"""<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Hello.</title></head>
<body>Goodbye.</body>
</html>"""
soup = self.soup(markup)
self.assertEqual(
soup.encode("utf-8").replace(b"\n", b""),
markup.replace(b"\n", b""))
def test_deepcopy(self):
"""Make sure you can copy the tree builder.
This is important because the builder is part of a
BeautifulSoup object, and we want to be able to copy that.
"""
copy.deepcopy(self.default_builder)
def test_p_tag_is_never_empty_element(self):
"""A <p> tag is never designated as an empty-element tag.
Even if the markup shows it as an empty-element tag, it
shouldn't be presented that way.
"""
soup = self.soup("<p/>")
self.assertFalse(soup.p.is_empty_element)
self.assertEqual(str(soup.p), "<p></p>")
def test_unclosed_tags_get_closed(self):
"""A tag that's not closed by the end of the document should be closed.
This applies to all tags except empty-element tags.
"""
self.assertSoupEquals("<p>", "<p></p>")
self.assertSoupEquals("<b>", "<b></b>")
self.assertSoupEquals("<br>", "<br/>")
def test_br_is_always_empty_element_tag(self):
"""A <br> tag is designated as an empty-element tag.
Some parsers treat <br></br> as one <br/> tag, some parsers as
two tags, but it should always be an empty-element tag.
"""
soup = self.soup("<br></br>")
self.assertTrue(soup.br.is_empty_element)
self.assertEqual(str(soup.br), "<br/>")
def test_nested_formatting_elements(self):
self.assertSoupEquals("<em><em></em></em>")
def test_comment(self):
# Comments are represented as Comment objects.
markup = "<p>foo<!--foobar-->baz</p>"
self.assertSoupEquals(markup)
soup = self.soup(markup)
comment = soup.find(text="foobar")
self.assertEqual(comment.__class__, Comment)
def test_preserved_whitespace_in_pre_and_textarea(self):
"""Whitespace must be preserved in <pre> and <textarea> tags."""
self.assertSoupEquals("<pre> </pre>")
self.assertSoupEquals("<textarea> woo </textarea>")
def test_nested_inline_elements(self):
"""Inline elements can be nested indefinitely."""
b_tag = "<b>Inside a B tag</b>"
self.assertSoupEquals(b_tag)
nested_b_tag = "<p>A <i>nested <b>tag</b></i></p>"
self.assertSoupEquals(nested_b_tag)
double_nested_b_tag = "<p>A <a>doubly <i>nested <b>tag</b></i></a></p>"
self.assertSoupEquals(nested_b_tag)
def test_nested_block_level_elements(self):
"""Block elements can be nested."""
soup = self.soup('<blockquote><p><b>Foo</b></p></blockquote>')
blockquote = soup.blockquote
self.assertEqual(blockquote.p.b.string, 'Foo')
self.assertEqual(blockquote.b.string, 'Foo')
def test_correctly_nested_tables(self):
"""One table can go inside another one."""
markup = ('<table id="1">'
'<tr>'
"<td>Here's another table:"
'<table id="2">'
'<tr><td>foo</td></tr>'
'</table></td>')
self.assertSoupEquals(
markup,
'<table id="1"><tr><td>Here\'s another table:'
'<table id="2"><tr><td>foo</td></tr></table>'
'</td></tr></table>')
self.assertSoupEquals(
"<table><thead><tr><td>Foo</td></tr></thead>"
"<tbody><tr><td>Bar</td></tr></tbody>"
"<tfoot><tr><td>Baz</td></tr></tfoot></table>")
def test_deeply_nested_multivalued_attribute(self):
# html5lib can set the attributes of the same tag many times
# as it rearranges the tree. This has caused problems with
# multivalued attributes.
markup = '<table><div><div class="css"></div></div></table>'
soup = self.soup(markup)
self.assertEqual(["css"], soup.div.div['class'])
def test_angle_brackets_in_attribute_values_are_escaped(self):
self.assertSoupEquals('<a b="<a>"></a>', '<a b="&lt;a&gt;"></a>')
def test_entities_in_attributes_converted_to_unicode(self):
expect = u'<p id="pi\N{LATIN SMALL LETTER N WITH TILDE}ata"></p>'
self.assertSoupEquals('<p id="pi&#241;ata"></p>', expect)
self.assertSoupEquals('<p id="pi&#xf1;ata"></p>', expect)
self.assertSoupEquals('<p id="pi&ntilde;ata"></p>', expect)
def test_entities_in_text_converted_to_unicode(self):
expect = u'<p>pi\N{LATIN SMALL LETTER N WITH TILDE}ata</p>'
self.assertSoupEquals("<p>pi&#241;ata</p>", expect)
self.assertSoupEquals("<p>pi&#xf1;ata</p>", expect)
self.assertSoupEquals("<p>pi&ntilde;ata</p>", expect)
def test_quot_entity_converted_to_quotation_mark(self):
self.assertSoupEquals("<p>I said &quot;good day!&quot;</p>",
'<p>I said "good day!"</p>')
def test_out_of_range_entity(self):
expect = u"\N{REPLACEMENT CHARACTER}"
self.assertSoupEquals("&#10000000000000;", expect)
self.assertSoupEquals("&#x10000000000000;", expect)
self.assertSoupEquals("&#1000000000;", expect)
def test_basic_namespaces(self):
"""Parsers don't need to *understand* namespaces, but at the
very least they should not choke on namespaces or lose
data."""
markup = b'<html xmlns="http://www.w3.org/1999/xhtml" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg"><head></head><body><mathml:msqrt>4</mathml:msqrt><b svg:fill="red"></b></body></html>'
soup = self.soup(markup)
self.assertEqual(markup, soup.encode())
html = soup.html
self.assertEqual('http://www.w3.org/1999/xhtml', soup.html['xmlns'])
self.assertEqual(
'http://www.w3.org/1998/Math/MathML', soup.html['xmlns:mathml'])
self.assertEqual(
'http://www.w3.org/2000/svg', soup.html['xmlns:svg'])
def test_multivalued_attribute_value_becomes_list(self):
markup = b'<a class="foo bar">'
soup = self.soup(markup)
self.assertEqual(['foo', 'bar'], soup.a['class'])
#
# Generally speaking, tests below this point are more tests of
# Beautiful Soup than tests of the tree builders. But parsers are
# weird, so we run these tests separately for every tree builder
# to detect any differences between them.
#
def test_soupstrainer(self):
"""Parsers should be able to work with SoupStrainers."""
strainer = SoupStrainer("b")
soup = self.soup("A <b>bold</b> <meta/> <i>statement</i>",
parse_only=strainer)
self.assertEqual(soup.decode(), "<b>bold</b>")
def test_single_quote_attribute_values_become_double_quotes(self):
self.assertSoupEquals("<foo attr='bar'></foo>",
'<foo attr="bar"></foo>')
def test_attribute_values_with_nested_quotes_are_left_alone(self):
text = """<foo attr='bar "brawls" happen'>a</foo>"""
self.assertSoupEquals(text)
def test_attribute_values_with_double_nested_quotes_get_quoted(self):
text = """<foo attr='bar "brawls" happen'>a</foo>"""
soup = self.soup(text)
soup.foo['attr'] = 'Brawls happen at "Bob\'s Bar"'
self.assertSoupEquals(
soup.foo.decode(),
"""<foo attr="Brawls happen at &quot;Bob\'s Bar&quot;">a</foo>""")
def test_ampersand_in_attribute_value_gets_escaped(self):
self.assertSoupEquals('<this is="really messed up & stuff"></this>',
'<this is="really messed up &amp; stuff"></this>')
self.assertSoupEquals(
'<a href="http://example.org?a=1&b=2;3">foo</a>',
'<a href="http://example.org?a=1&amp;b=2;3">foo</a>')
def test_escaped_ampersand_in_attribute_value_is_left_alone(self):
self.assertSoupEquals('<a href="http://example.org?a=1&amp;b=2;3"></a>')
def test_entities_in_strings_converted_during_parsing(self):
# Both XML and HTML entities are converted to Unicode characters
# during parsing.
text = "<p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>"
expected = u"<p>&lt;&lt;sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</p>"
self.assertSoupEquals(text, expected)
def test_smart_quotes_converted_on_the_way_in(self):
# Microsoft smart quotes are converted to Unicode characters during
# parsing.
quote = b"<p>\x91Foo\x92</p>"
soup = self.soup(quote)
self.assertEqual(
soup.p.string,
u"\N{LEFT SINGLE QUOTATION MARK}Foo\N{RIGHT SINGLE QUOTATION MARK}")
def test_non_breaking_spaces_converted_on_the_way_in(self):
soup = self.soup("<a>&nbsp;&nbsp;</a>")
self.assertEqual(soup.a.string, u"\N{NO-BREAK SPACE}" * 2)
def test_entities_converted_on_the_way_out(self):
text = "<p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>"
expected = u"<p>&lt;&lt;sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</p>".encode("utf-8")
soup = self.soup(text)
self.assertEqual(soup.p.encode("utf-8"), expected)
def test_real_iso_latin_document(self):
# Smoke test of interrelated functionality, using an
# easy-to-understand document.
# Here it is in Unicode. Note that it claims to be in ISO-Latin-1.
unicode_html = u'<html><head><meta content="text/html; charset=ISO-Latin-1" http-equiv="Content-type"/></head><body><p>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</p></body></html>'
# That's because we're going to encode it into ISO-Latin-1, and use
# that to test.
iso_latin_html = unicode_html.encode("iso-8859-1")
# Parse the ISO-Latin-1 HTML.
soup = self.soup(iso_latin_html)
# Encode it to UTF-8.
result = soup.encode("utf-8")
# What do we expect the result to look like? Well, it would
# look like unicode_html, except that the META tag would say
# UTF-8 instead of ISO-Latin-1.
expected = unicode_html.replace("ISO-Latin-1", "utf-8")
# And, of course, it would be in UTF-8, not Unicode.
expected = expected.encode("utf-8")
# Ta-da!
self.assertEqual(result, expected)
def test_real_shift_jis_document(self):
# Smoke test to make sure the parser can handle a document in
# Shift-JIS encoding, without choking.
shift_jis_html = (
b'<html><head></head><body><pre>'
b'\x82\xb1\x82\xea\x82\xcdShift-JIS\x82\xc5\x83R\x81[\x83f'
b'\x83B\x83\x93\x83O\x82\xb3\x82\xea\x82\xbd\x93\xfa\x96{\x8c'
b'\xea\x82\xcc\x83t\x83@\x83C\x83\x8b\x82\xc5\x82\xb7\x81B'
b'</pre></body></html>')
unicode_html = shift_jis_html.decode("shift-jis")
soup = self.soup(unicode_html)
# Make sure the parse tree is correctly encoded to various
# encodings.
self.assertEqual(soup.encode("utf-8"), unicode_html.encode("utf-8"))
self.assertEqual(soup.encode("euc_jp"), unicode_html.encode("euc_jp"))
def test_real_hebrew_document(self):
# A real-world test to make sure we can convert ISO-8859-9 (a
# Hebrew encoding) to UTF-8.
hebrew_document = b'<html><head><title>Hebrew (ISO 8859-8) in Visual Directionality</title></head><body><h1>Hebrew (ISO 8859-8) in Visual Directionality</h1>\xed\xe5\xec\xf9</body></html>'
soup = self.soup(
hebrew_document, from_encoding="iso8859-8")
self.assertEqual(soup.original_encoding, 'iso8859-8')
self.assertEqual(
soup.encode('utf-8'),
hebrew_document.decode("iso8859-8").encode("utf-8"))
def test_meta_tag_reflects_current_encoding(self):
# Here's the <meta> tag saying that a document is
# encoded in Shift-JIS.
meta_tag = ('<meta content="text/html; charset=x-sjis" '
'http-equiv="Content-type"/>')
# Here's a document incorporating that meta tag.
shift_jis_html = (
'<html><head>\n%s\n'
'<meta http-equiv="Content-language" content="ja"/>'
'</head><body>Shift-JIS markup goes here.') % meta_tag
soup = self.soup(shift_jis_html)
# Parse the document, and the charset is seemingly unaffected.
parsed_meta = soup.find('meta', {'http-equiv': 'Content-type'})
content = parsed_meta['content']
self.assertEqual('text/html; charset=x-sjis', content)
# But that value is actually a ContentMetaAttributeValue object.
self.assertTrue(isinstance(content, ContentMetaAttributeValue))
# And it will take on a value that reflects its current
# encoding.
self.assertEqual('text/html; charset=utf8', content.encode("utf8"))
# For the rest of the story, see TestSubstitutions in
# test_tree.py.
def test_html5_style_meta_tag_reflects_current_encoding(self):
# Here's the <meta> tag saying that a document is
# encoded in Shift-JIS.
meta_tag = ('<meta id="encoding" charset="x-sjis" />')
# Here's a document incorporating that meta tag.
shift_jis_html = (
'<html><head>\n%s\n'
'<meta http-equiv="Content-language" content="ja"/>'
'</head><body>Shift-JIS markup goes here.') % meta_tag
soup = self.soup(shift_jis_html)
# Parse the document, and the charset is seemingly unaffected.
parsed_meta = soup.find('meta', id="encoding")
charset = parsed_meta['charset']
self.assertEqual('x-sjis', charset)
# But that value is actually a CharsetMetaAttributeValue object.
self.assertTrue(isinstance(charset, CharsetMetaAttributeValue))
# And it will take on a value that reflects its current
# encoding.
self.assertEqual('utf8', charset.encode("utf8"))
def test_tag_with_no_attributes_can_have_attributes_added(self):
data = self.soup("<a>text</a>")
data.a['foo'] = 'bar'
self.assertEqual('<a foo="bar">text</a>', data.a.decode())
class XMLTreeBuilderSmokeTest(object):
def test_docstring_generated(self):
soup = self.soup("<root/>")
self.assertEqual(
soup.encode(), b'<?xml version="1.0" encoding="utf-8"?>\n<root/>')
def test_real_xhtml_document(self):
"""A real XHTML document should come out *exactly* the same as it went in."""
markup = b"""<?xml version="1.0" encoding="utf-8"?>