-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e31862
commit 9b23537
Showing
8 changed files
with
68 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from filters import filter | ||
import re | ||
|
||
class URLFilter(filter.Filter): | ||
def __init__(self): | ||
super().__init__(field='url_pattern', description='Individual URLs in each Post, matching a regex pattern.') | ||
self.operator = filter.Operators.MATCH | ||
self.accepts_operator = False | ||
|
||
|
||
def check(self, obj): | ||
regexp = re.compile(str(self.get_limit()), re.IGNORECASE) | ||
urls = obj.get_urls() | ||
for ur in urls: | ||
if not regexp.search( str(ur).lower()): | ||
obj.remove_url(ur) | ||
return len(obj.get_urls()) > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Happy New Year, Everyone! | ||
|
||
While I was away, a few of you found a couple bugs that I deemed important enough to push a small release for. | ||
|
||
I'm back now, and a few new features are in the works. In the mean time, this update will make sure the client can fully launch itself from scratch, as well as download posts with names that normally exceed the Windows filename limit. | ||
|
||
Special thanks to GreysenEvans & will76 for reporting and bugfixing these issues. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Release 1.53: | ||
|
||
This version patches a few small bits of code, and implements a new Filter option. | ||
|
||
Want to limit the sites you download from? Now with pattern support, you can do just that! | ||
|
||
Thanks to *will76* for the suggestion. | ||
|
||
### Change Log: | ||
|
||
+ Now supports filtering out any URLs that don't match a given pattern. | ||
+ Updating the program and running without a restart will now always properly reload the main file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters