daijro / courseherounblur Goto Github PK
View Code? Open in Web Editor NEW(⚠️DISCONTINUED⚠️) PoC Page Stitcher Image Manipulation Tool
License: Apache License 2.0
(⚠️DISCONTINUED⚠️) PoC Page Stitcher Image Manipulation Tool
License: Apache License 2.0
Traceback (most recent call last):
File "C:\xxx\xxx\xxx\CourseHeroUnblur-main\CourseHeroUnblur.py", line 2, in
from blessed import Terminal
ModuleNotFoundError: No module named 'blessed'
I realized that when you search for text in the coursehero document on google, it has the problem and answer in the page description. That means coursehero has a text version of the pdf openly available for web crawlers.
I don't know how you would get the full thing though. Theres a json in the html with some but not all problems/answers. Maybe make a request to the page disguised as a google web crawler.
(edit i put wrong image)
Thanks for the tool. ❤❤
Can you add support to download files from the https://www.coursehero.com/tutors-problems/*
endpoint. eg. the tool can download https://www.coursehero.com/file/61519475/Human-Services-Assignment-1-docx/
but not https://www.coursehero.com/tutors-problems/Social-Psychology/38685580-What-is-a-civic-professional-in-relation-to-the-Human-Service/
- Using Windows 10
I had an issue when trying to run the code. After I entered the URL into the console, an error message appeared:
"Request connection failed. Exiting..."
Output
C:\Users\User\AppData\Roaming\Python\Python39\site-packages\grequests.py:22: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util.ssl_ (C:\\Users\\User\\AppData\\Roaming\\Python\\Python39\\site-packages\\urllib3\\util\\ssl_.py)', 'urllib3.util (C:\\Users\\User\\AppData\\Roaming\\Python\\Python39\\site-packages\\urllib3\\util\\__init__.py)'].
curious_george.patch_all(thread=False, select=False)
[>] Enter the coursehero url: https://www.coursehero.com/file/39711060/BIO-101-Class-Notes-2docx/
[>] Request connection failed. Exiting...
I then removed the try-except statement from the code @ Line 88 and ran it again. This was the error I received:
"RecursionError: maximum recursion depth exceeded"
Output:
C:\Users\User\AppData\Roaming\Python\Python39\site-packages\grequests.py:22: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util (C:\\Users\\User\\AppData\\Roaming\\Python\\Python39\\site-packages\\urllib3\\util\\__init__.py)', 'urllib3.util.ssl_ (C:\\Users\\User\\AppData\\Roaming\\Python\\Python39\\site-packages\\urllib3\\util\\ssl_.py)'].
curious_george.patch_all(thread=False, select=False)
[>] Enter the coursehero url: https://www.coursehero.com/file/39711060/BIO-101-Class-Notes-2docx/
Traceback (most recent call last):
File "c:\Users\User\Downloads\CourseHeroUnblur.py", line 89, in <module>
resp = session.get(url, headers=make_headers())
File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\urllib3\connection.py", line 397, in connect
self.ssl_context = create_urllib3_context(
File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\urllib3\util\ssl_.py", line 312, in create_urllib3_context
context.options |= options
File "C:\Program Files\Python39\lib\ssl.py", line 602, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "C:\Program Files\Python39\lib\ssl.py", line 602, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "C:\Program Files\Python39\lib\ssl.py", line 602, in options
super(SSLContext, SSLContext).options.__set__(self, value)
[Previous line repeated 492 more times]
RecursionError: maximum recursion depth exceeded
I then went on StackOverflow here (first solution) and found out that I needed to add these two lines of code at the top of the code:
import gevent.monkey
gevent.monkey.patch_all()
After inserting those two lines at the top of the code, everything seems to work fine.
I don't know why the code isn't working before the fix. I thought I would just let you know here and perhaps help others
who might have the same issue. I have to say, I love this program. It's working great and I appreciate your time and effort.
Hi,
It would be amazing if you were continue this project
Workarounds I believe are possible to find.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.