summarylogtreecommitdiffstats
path: root/unix_original-scrape-mode.patch
diff options
context:
space:
mode:
Diffstat (limited to 'unix_original-scrape-mode.patch')
-rw-r--r--unix_original-scrape-mode.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/unix_original-scrape-mode.patch b/unix_original-scrape-mode.patch
new file mode 100644
index 000000000000..996cfead082c
--- /dev/null
+++ b/unix_original-scrape-mode.patch
@@ -0,0 +1,37 @@
+--- a/infinitychan.py
++++ b/infinitychan.py
+@@ -287,18 +287,21 @@
+ threadviewer.parser.parse_post(report['reason'])))
+
+
+-def scrape_files(board, thread, mode='unix'):
++def scrape_files(board, thread, mode='unix_original'):
+ """Download all of a thread's files."""
+ for post in posts(board, thread):
+ files = get_files(post)
+ for i, file in enumerate(files):
+- if mode == 'unix':
++ if mode == 'unix' \
++ or mode == 'unix_original':
+ if is_dedup(file):
+ name = str(post['time'] * 1000 + post['no'] % 1000)
+ if len(files) != 1:
+ name += '-{}'.format(i)
+ else:
+ name = file['tim']
++ if mode == 'unix_original':
++ name += '_' + file['filename']
+ elif mode == 'plain':
+ name = file['tim']
+ elif mode == 'original':
+--- a/infinityctl
++++ b/infinityctl
+@@ -72,7 +72,7 @@
+ ('-c', '--count'): {'action': 'store_true'},
+ ('-f', '--follow'): {'action': 'store_true'},
+ ('-i', '--interval'): {'type': float},
+- ('-m', '--mode'): {'choices': ('unix', 'plain', 'original')},
++ ('-m', '--mode'): {'choices': ('unix', 'plain', 'original', 'unix_original')},
+ ('-n', '--number'): {'type': int},
+ ('-o', '--ocr'): {'action': 'store_true'},
+ ('-r', '--raw'): {'action': 'store_true'},