Skip to content

Commit

Permalink
Update required libraries
Browse files Browse the repository at this point in the history
- Add websocket-client
- Re-enable fake-useragent
- Update fallback user-agent
  • Loading branch information
wlerin committed Mar 13, 2020
1 parent fe67b80 commit 96b9b01
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
23 changes: 6 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ To download only specific members' rooms, use:
To set a different data directory, use:

python showroom.py --data-dir <data directory> [--all or "Member Name"]

For additional options, type:

python showroom.py --help
Expand All @@ -39,7 +40,8 @@ Or take a gander at the start.sh script.

## Installation

Requires FFmpeg, Python 3.5+, and Requests
Requires FFmpeg, Python 3.5+, and the Python libraries requests,
websocket-client, and pyyaml

##### 1. Install ffmpeg

Expand Down Expand Up @@ -104,26 +106,13 @@ Or use the Download as ZIP button above.

##### 5. Install Required Python Packages

- [Requests](http://docs.python-requests.org/en/master/)

Both of these packages can be installed by running:
All required packages can be installed by running:

pip install -r requirements.txt

in the showroom-dev directory.

##### 6. (Optional) Install PyYAML

- [PyYAML](http://pyyaml.org/wiki/PyYAMLDocumentation)

Required if you want to format your config files using YAML instead
of JSON. In the future this may also be an option for output. You
may wish to install libyaml as well (see the
[libYAML](http://pyyaml.org/wiki/LibYAML) docs) for faster parsing.

pip install pyyaml
in the showroom directory.

##### 7. (Optional) Install index_maker Dependencies
##### 6. (Optional) Install index_maker Dependencies

- [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/)

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
requests
fake-useragent
pyyaml
websocket-client
Empty file removed showroom/api.py
Empty file.
18 changes: 9 additions & 9 deletions showroom/api/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import time
from .cookiejar import ClientCookieJar

#try:
# from fake_useragent import UserAgent
#except ImportError:
# UserAgent = None
# ua = None
ua_str = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36'
#else:
# ua = UserAgent(fallback='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36')
# ua_str = ua.chrome
try:
from fake_useragent import UserAgent
except ImportError:
UserAgent = None
ua = None
ua_str = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36'
else:
ua = UserAgent(fallback='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36')
ua_str = ua.chrome

session_logger = logging.getLogger('showroom.session')

Expand Down

0 comments on commit 96b9b01

Please sign in to comment.