From 42148e0749e02d82a60f247847798ffbd6bc0067713819409d3cdb7e987af03f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Fri, 12 Jan 2018 07:57:34 +0000 Subject: [PATCH] Accepting request 563713 from home:lachs0r Depends on 563712. - init, 1.9.1 OBS-URL: https://build.opensuse.org/request/show/563713 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cfscrape?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++++ .gitignore | 1 + cfscrape-1.9.1.tar.gz | 3 ++ python-cfscrape.changes | 4 +++ python-cfscrape.spec | 69 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 cfscrape-1.9.1.tar.gz create mode 100644 python-cfscrape.changes create mode 100644 python-cfscrape.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/cfscrape-1.9.1.tar.gz b/cfscrape-1.9.1.tar.gz new file mode 100644 index 0000000..7949311 --- /dev/null +++ b/cfscrape-1.9.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cee3708c643904eaa010a64dd1715890457bb77010d87405fc1bfeb892508d7 +size 3568 diff --git a/python-cfscrape.changes b/python-cfscrape.changes new file mode 100644 index 0000000..19e2731 --- /dev/null +++ b/python-cfscrape.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Thu Jan 11 11:19:00 UTC 2018 - 9@cirno.systems + +- init, 1.9.1 diff --git a/python-cfscrape.spec b/python-cfscrape.spec new file mode 100644 index 0000000..ca1413b --- /dev/null +++ b/python-cfscrape.spec @@ -0,0 +1,69 @@ +# +# spec file for package python-cfscrape +# +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-cfscrape +Version: 1.9.1 +Release: 0 +Summary: Python module to bypass Cloudflare's anti-bot page +License: MIT +Group: Development/Languages/Python +URL: https://github.com/Anorov/cloudflare-scrape +Source: https://files.pythonhosted.org/packages/source/c/cfscrape/cfscrape-%{version}.tar.gz +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: nodejs +Requires: python-PyExecJS +Requires: python-requests +BuildArch: noarch +%python_subpackages + +%description +A simple Python module to bypass Cloudflare's anti-bot page (also known as "I'm +Under Attack Mode", or IUAM), implemented with Requests. + +This can be useful if you wish to scrape or crawl a website protected with +Cloudflare. Cloudflare's anti-bot page currently just checks if the client +supports Javascript, though they may add additional techniques in the future. + +Due to Cloudflare continually changing and hardening their protection page, +cfscrape requires Node.js to solve Javascript challenges. This allows the script +to easily impersonate a regular web browser without explicitly deobfuscating and +parsing Cloudflare's Javascript. + +Note: This only works when regular Cloudflare anti-bots is enabled (the +"Checking your browser before accessing..." loading page). If there is a +reCAPTCHA challenge, you're out of luck. Thankfully, the Javascript check page +is much more common. + +%prep +%setup -q -n cfscrape-%{version} + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%files %{python_files} +%{python_sitelib}/* + +%changelog