Skip to content

Commit b52b7dc

Browse files
author
Pascal Wacker
committed
moving config to download folder
1 parent 7baa691 commit b52b7dc

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.vscode
22
downloads/*
33
!downloads/.gitkeep
4+
!downloads/config.json
45

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ WORKDIR /app
77
# Copy the current directory contents into the container at /app
88
ADD requirements.txt /app/requirements.txt
99
ADD downloader.py /app/downloader.py
10-
ADD config.json /app/config.json
1110

1211
# Install any needed packages specified in requirements.txt
1312
RUN pip install --trusted-host pypi.python.org -r requirements.txt
1413

1514
# Run app.py when the container launches
16-
CMD ["python", "downloader.py"]
15+
CMD ["python", "downloader.py"]

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ Docker scripts to download videos from the ETH Zürich video portal
99

1010
## Howto:
1111
1) Clone (or download) this repo
12-
2) Modify the `config.json` script and add your courses.
12+
2) Modify the `downloads/config.json` script and add your courses.
1313
3) Run `docker run -v $(pwd)/downloads:/app/downloads pascalwacker/eth-video-downloader:version-1.0` to run the docker image directly from docker cloud
1414

15+
## Options:
16+
In `downloads/config.json` the key `existing` accepts either `overwrite` or `skip`. Default is `overwrite`. `overwrite` will overwrite existing files, while `skip` skips them.
17+
1518
## Alternative (build the docker image yourself):
1619
1) Clone (or download) this repo
17-
2) Modify the `config.json` script and add your courses.
20+
2) Modify the `downloads/config.json` script and add your courses.
1821
3) Run `docker build -t eth-video-downloader .`
1922
4) Run `docker run -v $(pwd)/downloads:/app/downloads eth-video-downloader`
2023

2124
## Note:
2225
If you have permission issues in the download folder after running this script, you can add ` && sudo chown $(whoami):$(whoami) -R downloads` at the end of the `docker run` command. This will change the permission of both user and group to the current user
2326

2427
## Disclaimer:
25-
This software is provided as is. The are not responsible for any damages on your system or legal actions brought forward against you. Only use it if you're allowed to save the videos on your hardware by ETH Zürich (http://www.video.ethz.ch/footer/copyright.html)
28+
This software is provided as is. The are not responsible for any damages on your system or legal actions brought forward against you. Only use it if you're allowed to save the videos on your hardware by ETH Zürich (http://www.video.ethz.ch/footer/copyright.html)

downloader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def dlProgress(count, blockSize, totalSize):
1010
print('\r' + str(round(count * blockSize * 100 / totalSize)) + '%: ' + str('#' * round(count * blockSize * 100 / totalSize / 5)) + str('_' * (20-round(count * blockSize * 100 / totalSize / 5))), end="")
1111

1212
def main():
13-
data = json.load(open('/app/config.json'))
13+
data = json.load(open('/app/downloads/config.json'))
1414

1515
mode = 'overwrite'
1616
if data['existing'] and data['existing'] == 'skip':
@@ -52,4 +52,4 @@ def main():
5252
print('no targets given')
5353

5454
if __name__ == '__main__':
55-
main()
55+
main()
File renamed without changes.

0 commit comments

Comments
 (0)