summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorarya2020-01-29 00:49:19 -0500
committerarya2020-01-29 00:49:19 -0500
commitb62efcd6ef892eb746126da22389086780ccbe68 (patch)
tree812e025403523b1a8ce1601766e6a59d99269c3d
downloadaur-b62efcd6ef892eb746126da22389086780ccbe68.tar.gz
Initial commit
-rw-r--r--.SRCINFO30
-rw-r--r--0001-Add-setup.py.patch43
-rw-r--r--0002-Add-unix_original-file-scrape-mode.patch55
-rw-r--r--0003-Fix-for-file-names-which-potentially-exceed-the-file.patch38
-rw-r--r--0004-Remove-defunct-variants.patch87
-rw-r--r--0005-Use-8kun.top-addresses.patch61
-rw-r--r--0006-Add-variants-for-smuglo.li.patch87
-rw-r--r--PKGBUILD53
8 files changed, 454 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..60542ec69da0
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,30 @@
+pkgbase = infinityctl-git
+ pkgdesc = Command line interface for 8chan
+ pkgver = latest
+ pkgrel = 1
+ url = https://gitgud.io/ring/infinityctl
+ arch = any
+ license = GPL3
+ makedepends = git
+ makedepends = python-setuptools
+ depends = python
+ depends = python-urllib3
+ optdepends = tesseract
+ optdepends = imagemagick
+ source = git+https://gitgud.io/ring/infinityctl
+ source = 0001-Add-setup.py.patch
+ source = 0002-Add-unix_original-file-scrape-mode.patch
+ source = 0003-Fix-for-file-names-which-potentially-exceed-the-file.patch
+ source = 0004-Remove-defunct-variants.patch
+ source = 0005-Use-8kun.top-addresses.patch
+ source = 0006-Add-variants-for-smuglo.li.patch
+ sha256sums = SKIP
+ sha256sums = d07d1e661e9361eae4d9ef181fed0b41ef1c0f726cb77cd1374b71e470ecfcda
+ sha256sums = 6e511397568acc0a619f73243cf2a52ac306557d9da93cb90a420a6550f059c8
+ sha256sums = 45763115641e5616b17bf2a6d8e791889852c8de0a16364769658af0ec06bcdd
+ sha256sums = 794d37c153946095b7ef67d17ac9c2adc848b4babad37f013edec9ff0d0dc6e4
+ sha256sums = a2414a02188f1824733d6d0e78ad8d98b16f902a0cbc6ba4f821d48d56112f9a
+ sha256sums = fa4bb1349955b94f3ca1d1577e3811496c6de360fd93b86bcec3814c30c67a9d
+
+pkgname = infinityctl-git
+
diff --git a/0001-Add-setup.py.patch b/0001-Add-setup.py.patch
new file mode 100644
index 000000000000..2439b6b57850
--- /dev/null
+++ b/0001-Add-setup.py.patch
@@ -0,0 +1,43 @@
+From 400f5d00022d6094d4c49631fcc1134db71185d8 Mon Sep 17 00:00:00 2001
+From: neeshy <neeshy@tfwno.gf>
+Date: Fri, 1 Mar 2019 01:27:57 -0500
+Subject: [PATCH 1/6] Add setup.py
+
+---
+ setup.py | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+ create mode 100644 setup.py
+
+diff --git a/setup.py b/setup.py
+new file mode 100644
+index 0000000..5ea51b9
+--- /dev/null
++++ b/setup.py
+@@ -0,0 +1,24 @@
++from setuptools import setup
++
++with open('README.md') as fh:
++ long_description = fh.read()
++
++setup(
++ name='infinityctl',
++ author='ring',
++ author_email='ring@8chan.co',
++ description='Command line interface for 8chan',
++ long_description=long_description,
++ long_description_content_type='text/markdown',
++ license='GPL3',
++ classifiers=[
++ 'Programming Language :: Python :: 3',
++ 'Development Status :: 5 - Production/Stable',
++ 'Environment :: Console',
++ 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
++ 'Intended Audience :: End Users/Desktop'],
++ py_modules=['infinitychan', 'infinityctl', 'botmod', 'threadviewer', 'urls'],
++ scripts=['infinityctl', 'onionctl', 'finalchanctl', 'vichanctl'],
++ install_requires=['urllib3'],
++ python_requires='>=3.0'
++)
+--
+2.25.0
+
diff --git a/0002-Add-unix_original-file-scrape-mode.patch b/0002-Add-unix_original-file-scrape-mode.patch
new file mode 100644
index 000000000000..9820b7173a4b
--- /dev/null
+++ b/0002-Add-unix_original-file-scrape-mode.patch
@@ -0,0 +1,55 @@
+From 7e6d910e31b338f3cfe6dcca6724c6b4b6084a7e Mon Sep 17 00:00:00 2001
+From: neeshy <neeshy@tfwno.gf>
+Date: Mon, 11 Jun 2018 21:22:06 -0400
+Subject: [PATCH 2/6] Add 'unix_original' file scrape mode
+
+and make it default
+---
+ infinitychan.py | 7 +++++--
+ infinityctl | 2 +-
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/infinitychan.py b/infinitychan.py
+index f65c33e..94c81ea 100644
+--- a/infinitychan.py
++++ b/infinitychan.py
+@@ -287,18 +287,21 @@ def render_report(report):
+ 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':
+diff --git a/infinityctl b/infinityctl
+index 304c895..f9c052e 100755
+--- a/infinityctl
++++ b/infinityctl
+@@ -72,7 +72,7 @@ argopts = {
+ ('-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'},
+--
+2.25.0
+
diff --git a/0003-Fix-for-file-names-which-potentially-exceed-the-file.patch b/0003-Fix-for-file-names-which-potentially-exceed-the-file.patch
new file mode 100644
index 000000000000..98627ac9e841
--- /dev/null
+++ b/0003-Fix-for-file-names-which-potentially-exceed-the-file.patch
@@ -0,0 +1,38 @@
+From a3d2fa9b95326cc8b7ff062d5746bba700996e5d Mon Sep 17 00:00:00 2001
+From: neeshy <neeshy@tfwno.gf>
+Date: Sat, 3 Nov 2018 16:33:30 -0400
+Subject: [PATCH 3/6] Fix for file names which potentially exceed the file name
+ length limit
+
+---
+ infinitychan.py | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/infinitychan.py b/infinitychan.py
+index 94c81ea..2f17aa2 100644
+--- a/infinitychan.py
++++ b/infinitychan.py
+@@ -301,11 +301,18 @@ def scrape_files(board, thread, mode='unix_original'):
+ else:
+ name = file['tim']
+ if mode == 'unix_original':
+- name += '_' + file['filename']
++ if len(''.join([name, '_', file['filename'],
++ file['ext']]).encode('utf-8')) \
++ <= os.statvfs(os.getcwd()).f_namemax:
++ name += '_' + file['filename']
+ elif mode == 'plain':
+ name = file['tim']
+ elif mode == 'original':
+- name = file['filename']
++ if len((file['filename'] + file['ext']).encode('utf-8')) \
++ <= os.statvfs(os.getcwd()).f_namemax:
++ name = file['filename']
++ else:
++ name = file['tim']
+ else:
+ raise RuntimeError("Unknown mode {}".format(mode))
+ name += file['ext']
+--
+2.25.0
+
diff --git a/0004-Remove-defunct-variants.patch b/0004-Remove-defunct-variants.patch
new file mode 100644
index 000000000000..01884366cdb5
--- /dev/null
+++ b/0004-Remove-defunct-variants.patch
@@ -0,0 +1,87 @@
+From 7b7f68a7a62eb2bd08651183ecb49571f2f690a2 Mon Sep 17 00:00:00 2001
+From: neeshy <neeshy@tfwno.gf>
+Date: Wed, 29 Jan 2020 00:27:59 -0500
+Subject: [PATCH 4/6] Remove defunct variants
+
+---
+ finalchanctl | 23 -----------------------
+ setup.py | 2 +-
+ vichanctl | 23 -----------------------
+ 3 files changed, 1 insertion(+), 47 deletions(-)
+ delete mode 100755 finalchanctl
+ delete mode 100755 vichanctl
+
+diff --git a/finalchanctl b/finalchanctl
+deleted file mode 100755
+index befdf41..0000000
+--- a/finalchanctl
++++ /dev/null
+@@ -1,23 +0,0 @@
+-#!/usr/bin/env python3
+-# Copyright 2016 ring <ring@8chan.co>
+-# Copying and distribution of this file, with or without modification,
+-# are permitted in any medium without royalty provided the copyright
+-# notice and this notice are preserved. This file is offered as-is,
+-# without any warranty.
+-
+-"""infinityctl variant for finalchan.net"""
+-
+-import os
+-
+-import infinitychan
+-import infinityctl
+-
+-infinitychan.dom = "https://finalchan.net"
+-infinitychan.mod = "https://finalchan.net/mod.php?"
+-infinitychan.sys = "https://finalchan.net"
+-infinitychan.media_base = "https://finalchan.net"
+-infinitychan.media = "https://finalchan.net/{board}/src/{tim}{ext}"
+-infinitychan.media_dedup = infinitychan.media
+-infinitychan.config = os.path.join(os.path.expanduser("~"), ".finalchanctl")
+-
+-infinityctl.main()
+diff --git a/setup.py b/setup.py
+index 5ea51b9..619fa5d 100644
+--- a/setup.py
++++ b/setup.py
+@@ -18,7 +18,7 @@ setup(
+ 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
+ 'Intended Audience :: End Users/Desktop'],
+ py_modules=['infinitychan', 'infinityctl', 'botmod', 'threadviewer', 'urls'],
+- scripts=['infinityctl', 'onionctl', 'finalchanctl', 'vichanctl'],
++ scripts=['infinityctl', 'onionctl'],
+ install_requires=['urllib3'],
+ python_requires='>=3.0'
+ )
+diff --git a/vichanctl b/vichanctl
+deleted file mode 100755
+index 3b2bf3c..0000000
+--- a/vichanctl
++++ /dev/null
+@@ -1,23 +0,0 @@
+-#!/usr/bin/env python3
+-# Copyright 2016 ring <ring@8chan.co>
+-# Copying and distribution of this file, with or without modification,
+-# are permitted in any medium without royalty provided the copyright
+-# notice and this notice are preserved. This file is offered as-is,
+-# without any warranty.
+-
+-"""infinityctl variant for 8ch.pl (soon to become vichan.net)"""
+-
+-import os
+-
+-import infinitychan
+-import infinityctl
+-
+-infinitychan.dom = "https://8ch.pl"
+-infinitychan.mod = "https://8ch.pl/mod.php?"
+-infinitychan.sys = "https://8ch.pl"
+-infinitychan.media_base = "https://8ch.pl"
+-infinitychan.media = "https://8ch.pl/{board}/src/{tim}{ext}"
+-infinitychan.media_dedup = infinitychan.media
+-infinitychan.config = os.path.join(os.path.expanduser("~"), ".vichanctl")
+-
+-infinityctl.main()
+--
+2.25.0
+
diff --git a/0005-Use-8kun.top-addresses.patch b/0005-Use-8kun.top-addresses.patch
new file mode 100644
index 000000000000..5b7296b964c3
--- /dev/null
+++ b/0005-Use-8kun.top-addresses.patch
@@ -0,0 +1,61 @@
+From 11aa63d34689dd95f864ffc5db0d4f35bccfbb12 Mon Sep 17 00:00:00 2001
+From: neeshy <neeshy@tfwno.gf>
+Date: Sun, 17 Feb 2019 05:40:27 -0500
+Subject: [PATCH 5/6] Use 8kun.top addresses
+
+---
+ infinitychan.py | 12 ++++++------
+ onionctl | 14 ++++++--------
+ 2 files changed, 12 insertions(+), 14 deletions(-)
+
+diff --git a/infinitychan.py b/infinitychan.py
+index 2f17aa2..2a27bbe 100644
+--- a/infinitychan.py
++++ b/infinitychan.py
+@@ -26,12 +26,12 @@ import re
+ import threadviewer
+ import urls
+
+-dom = "https://8ch.net"
+-mod = "https://sys.8ch.net/mod.php?"
+-sys = "https://sys.8ch.net"
+-media_base = "https://media.8ch.net"
+-media = "https://media.8ch.net/{board}/src/{tim}{ext}"
+-media_dedup = "https://media.8ch.net/file_store/{tim}{ext}"
++dom = "https://8kun.top"
++mod = "https://sys.8kun.top/mod.php?"
++sys = "https://sys.8kun.top"
++media_base = "https://media.8kun.top"
++media = "https://media.8kun.top/{board}/src/{tim}{ext}"
++media_dedup = "https://media.8kun.top/file_store/{tim}{ext}"
+
+ config = os.path.join(os.path.expanduser("~"), ".infinityctl")
+
+diff --git a/onionctl b/onionctl
+index bb468e4..81dfa6e 100755
+--- a/onionctl
++++ b/onionctl
+@@ -12,14 +12,12 @@ import os
+ import infinitychan
+ import infinityctl
+
+-dom = "http://oxwugzccvk3dk6tj.onion"
+-infinitychan.dom = dom
+-infinitychan.mod = dom + "/mod.php?"
+-infinitychan.sys = dom
+-infinitychan.media_base = dom
+-infinitychan.media = dom + "/{board}/src/{tim}{ext}"
+-infinitychan.media_dedup = infinitychan.media
+-infinitychan.media_dedup = dom + "/file_store/{tim}{ext}"
++infinitychan.dom = "http://jthnx5wyvjvzsxtu.onion"
++infinitychan.mod = infinitychan.dom + "/mod.php?"
++infinitychan.sys = infinitychan.dom
++infinitychan.media_base = infinitychan.dom
++infinitychan.media = infinitychan.dom + "/{board}/src/{tim}{ext}"
++infinitychan.media_dedup = infinitychan.dom + "/file_store/{tim}{ext}"
+ infinitychan.config = os.path.join(os.path.expanduser("~"), ".onionctl")
+
+ infinityctl.main()
+--
+2.25.0
+
diff --git a/0006-Add-variants-for-smuglo.li.patch b/0006-Add-variants-for-smuglo.li.patch
new file mode 100644
index 000000000000..35e2c49e144b
--- /dev/null
+++ b/0006-Add-variants-for-smuglo.li.patch
@@ -0,0 +1,87 @@
+From 4edf5a82248c99513b218ef90698bfa0a67e3a7f Mon Sep 17 00:00:00 2001
+From: neeshy <neeshy@tfwno.gf>
+Date: Thu, 29 Aug 2019 11:52:43 -0400
+Subject: [PATCH 6/6] Add variants for smuglo.li
+
+---
+ onionlolictl | 23 +++++++++++++++++++++++
+ setup.py | 2 +-
+ smuglolictl | 23 +++++++++++++++++++++++
+ 3 files changed, 47 insertions(+), 1 deletion(-)
+ create mode 100755 onionlolictl
+ create mode 100755 smuglolictl
+
+diff --git a/onionlolictl b/onionlolictl
+new file mode 100755
+index 0000000..1146692
+--- /dev/null
++++ b/onionlolictl
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python3
++# Copyright 2016 ring <ring@8chan.co>
++# Copying and distribution of this file, with or without modification,
++# are permitted in any medium without royalty provided the copyright
++# notice and this notice are preserved. This file is offered as-is,
++# without any warranty.
++
++"""infinityctl variant for smuglo.li (onion)"""
++
++import os
++
++import infinitychan
++import infinityctl
++
++infinitychan.dom = "http://bhm5koavobq353j54qichcvzr6uhtri6x4bjjy4xkybgvxkzuslzcqid.onion"
++infinitychan.mod = infinitychan.dom + "/mod.php?"
++infinitychan.sys = infinitychan.dom
++infinitychan.media_base = infinitychan.dom
++infinitychan.media = infinitychan.dom + "/{board}/src/{tim}{ext}"
++infinitychan.media_dedup = infinitychan.media
++infinitychan.config = os.path.join(os.path.expanduser("~"), ".onionlolictl")
++
++infinityctl.main()
+diff --git a/setup.py b/setup.py
+index 619fa5d..d3e587b 100644
+--- a/setup.py
++++ b/setup.py
+@@ -18,7 +18,7 @@ setup(
+ 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
+ 'Intended Audience :: End Users/Desktop'],
+ py_modules=['infinitychan', 'infinityctl', 'botmod', 'threadviewer', 'urls'],
+- scripts=['infinityctl', 'onionctl'],
++ scripts=['infinityctl', 'onionctl', 'smuglolictl', 'onionlolictl'],
+ install_requires=['urllib3'],
+ python_requires='>=3.0'
+ )
+diff --git a/smuglolictl b/smuglolictl
+new file mode 100755
+index 0000000..3723620
+--- /dev/null
++++ b/smuglolictl
+@@ -0,0 +1,23 @@
++#!/usr/bin/env python3
++# Copyright 2016 ring <ring@8chan.co>
++# Copying and distribution of this file, with or without modification,
++# are permitted in any medium without royalty provided the copyright
++# notice and this notice are preserved. This file is offered as-is,
++# without any warranty.
++
++"""infinityctl variant for smuglo.li"""
++
++import os
++
++import infinitychan
++import infinityctl
++
++infinitychan.dom = "https://smuglo.li"
++infinitychan.mod = infinitychan.dom + "/mod.php?"
++infinitychan.sys = infinitychan.dom
++infinitychan.media_base = infinitychan.dom
++infinitychan.media = infinitychan.dom + "/{board}/src/{tim}{ext}"
++infinitychan.media_dedup = infinitychan.media
++infinitychan.config = os.path.join(os.path.expanduser("~"), ".smuglolictl")
++
++infinityctl.main()
+--
+2.25.0
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..48916ea6399f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,53 @@
+# Maintainer: neeshy <neeshy@tfwno.gf>
+
+_pkgname=infinityctl
+pkgname="$_pkgname-git"
+pkgver=latest
+pkgrel=1
+pkgdesc="Command line interface for 8chan"
+arch=('any')
+url="https://gitgud.io/ring/infinityctl"
+license=('GPL3')
+depends=('python' 'python-urllib3')
+makedepends=('git' 'python-setuptools')
+optdepends=('tesseract' 'imagemagick')
+source=("git+https://gitgud.io/ring/infinityctl"
+ "0001-Add-setup.py.patch"
+ "0002-Add-unix_original-file-scrape-mode.patch"
+ "0003-Fix-for-file-names-which-potentially-exceed-the-file.patch"
+ "0004-Remove-defunct-variants.patch"
+ "0005-Use-8kun.top-addresses.patch"
+ "0006-Add-variants-for-smuglo.li.patch")
+sha256sums=('SKIP'
+ 'd07d1e661e9361eae4d9ef181fed0b41ef1c0f726cb77cd1374b71e470ecfcda'
+ '6e511397568acc0a619f73243cf2a52ac306557d9da93cb90a420a6550f059c8'
+ '45763115641e5616b17bf2a6d8e791889852c8de0a16364769658af0ec06bcdd'
+ '794d37c153946095b7ef67d17ac9c2adc848b4babad37f013edec9ff0d0dc6e4'
+ 'a2414a02188f1824733d6d0e78ad8d98b16f902a0cbc6ba4f821d48d56112f9a'
+ 'fa4bb1349955b94f3ca1d1577e3811496c6de360fd93b86bcec3814c30c67a9d')
+
+pkgver() {
+ cd "$srcdir/$_pkgname"
+ printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "$srcdir/$_pkgname"
+ patch -Np1 -i "$srcdir/0001-Add-setup.py.patch"
+ patch -Np1 -i "$srcdir/0002-Add-unix_original-file-scrape-mode.patch"
+ patch -Np1 -i "$srcdir/0003-Fix-for-file-names-which-potentially-exceed-the-file.patch"
+ patch -Np1 -i "$srcdir/0004-Remove-defunct-variants.patch"
+ patch -Np1 -i "$srcdir/0005-Use-8kun.top-addresses.patch"
+ patch -Np1 -i "$srcdir/0006-Add-variants-for-smuglo.li.patch"
+}
+
+build() {
+ cd "$srcdir/$_pkgname"
+ python setup.py build
+}
+
+package() {
+ cd "$srcdir/$_pkgname"
+ python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
+ install -Dm644 COPYING "$pkgdir/usr/share/licenses/$_pkgname/COPYING"
+}