Giter Site home page Giter Site logo

seriousm4x / twitch-clip-archive Goto Github PK

View Code? Open in Web Editor NEW
36.0 4.0 3.0 13.44 MB

This project creates a complete off side backup of the clips of a Twitch streamer.

Home Page: https://clips.itssoley.de

License: MIT License

Python 12.23% HTML 10.85% CSS 73.29% JavaScript 0.81% Shell 2.66% Dockerfile 0.15%
django twitch clips python

twitch-clip-archive's Introduction

Django-Twitch-Archive

Twitch Clip Archive

This project creates a complete off side backup of the clips of a Twitch streamer. Top clips on the start page per week/month/ever, search function, sorting and statistics. A live demo can be seen here.

Screenshots

Show me

Font page images/home.png

Single clip images/clip.png

Search images/search.png

Statistics images/stats.png

Installation

git clone https://github.com/seriousm4x/django-twitch-archive.git
cd django-twitch-archive

Copy TEMPLATE.env to '.env' and edit it with your variables.

docker-compose up

Congrats, we are up and running for development or private use. Open up http://localhost:8000. If you want to publish your archive, go on reading.

Also, you shouldn't use the default django key in your .env file. Go ahead and generate a new one.

docker exec -it dta-web python manage.py shell -c 'from django.core.management import utils; print(utils.get_random_secret_key())'

Edit and paste the generated key in your .env file under DJANGO_SECRET_KEY.

Also set DJANGO_DEBUG=False and enter your domain under DJANGO_ALLOWED_HOSTS.

Reverse proxy setup (Caddy)

A webserver with reverse proxy is required. You can just use the caddy example below or use your personal prefered reverse proxy, but make sure to exclude /static/* and /media/* from reverse proxying.

yourdomain.com {
    root * /var/www/
    @notStatic {
        not path /static/* /media/*
    }
    reverse_proxy @notStatic localhost:8000
    file_server
    encode gzip
}

twitch-clip-archive's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar seriousm4x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

twitch-clip-archive's Issues

"Page not found" for static files

Hi,

i'm facing an issue with static files not loading.

Debug Output is the following:

Using the URLconf defined in django-twitch-archive.urls, Django tried these URL patterns, in this order:

admin/
[name='index']
top/week/ [name='topweek']
top/month/ [name='topmonth']
top/alltime/ [name='topalltime']
search/ [name='search_results']
stats/ [name='statistics']
<slug:clip_id>/ [name='singleclip']
^media/(?P<path>.*)$

The current path, static/css/all.min.css, didn't match any of these.

Output in console:

dta-web | 0 static files copied to '/var/www/static', 149 unmodified.
dta-web | Not Found: /static/css/all.min.css
dta-web | Not Found: /favicon.ico
dta-web | Not Found: /static/admin/css/nav_sidebar.css
dta-web | Not Found: /static/admin/css/base.css
dta-web | Not Found: /static/admin/js/nav_sidebar.js
dta-web | Not Found: /static/admin/css/login.css
dta-web | Not Found: /static/admin/css/responsive.css

This happens when accessing the Django application directly (no reverse proxy for now).

Any idea what is happing here?

'Command' object has no attribute 'broadcaster_id'

I am trying to get this up and running but get an error when trying. It was working all right with Postgresql disabled but I wasn't able to see any styling and saw a few errors when it tried accessing the static files

Here's the main error I was seeing

dta-web | [2020-10-24 12:35:32 +0000] [31] [INFO] Starting gunicorn 20.0.4
dta-web | [2020-10-24 12:35:32 +0000] [31] [INFO] Listening at: http://0.0.0.0:8000 (31)
dta-web | [2020-10-24 12:35:32 +0000] [31] [INFO] Using worker: sync
dta-web | [2020-10-24 12:35:32 +0000] [36] [INFO] Booting worker with pid: 36
dta-web | [2020-10-24 12:35:33 +0000] [37] [INFO] Booting worker with pid: 37
dta-web | [2020-10-24 12:35:33 +0000] [38] [INFO] Booting worker with pid: 38
dta-web | HTTP error occurred: 400 Client Error: Bad Request for url: https://id.twitch.tv/oauth2/token?client_id=%3Cclient-id%3E&client_secret=%3Cclient-secret%3E&grant_type=client_credentials
dta-web | [2020-10-24 12:35:33 +0000] [39] [INFO] Booting worker with pid: 39
dta-web | Updated Twitch credentials
dta-web | Filling database with clips
dta-web | Traceback (most recent call last):
dta-web |   File "manage.py", line 22, in <module>
dta-web |     main()
dta-web |   File "manage.py", line 18, in main
dta-web |     execute_from_command_line(sys.argv)
dta-web |   File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
dta-web |     utility.execute()
dta-web |   File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
dta-web |     self.fetch_command(subcommand).run_from_argv(self.argv)
dta-web |   File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
dta-web |     self.execute(*args, **cmd_options)
dta-web |   File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute
dta-web |     output = self.handle(*args, **options)
dta-web |   File "/opt/app/clips/management/commands/updateDB.py", line 62, in handle
dta-web |     self.updateClips()
dta-web |   File "/opt/app/clips/management/commands/updateDB.py", line 71, in updateClips
dta-web |     self.broadcaster_id), headers=self.kraken_header).json()["created_at"]
dta-web | AttributeError: 'Command' object has no attribute 'broadcaster_id'
dta-web | [2020-10-24 12:35:33 +0000] [40] [INFO] Booting worker with pid: 40

and the missing styling/images

dta-web | 2020-10-10T12:34:23.919786Z
dta-web | Not Found: /static/svg/logo.svg
dta-web | Not Found: /static/svg/clip-offline.svg
dta-web | Not Found: /media/game_thumbnails/510218.jpg
dta-web | Not Found: /static/svg/twitch.svg
dta-web | Not Found: /media/game_thumbnails/18122.jpg
dta-web | Not Found: /media/game_thumbnails/518184.jpg
dta-web | Not Found: /media/game_thumbnails/509658.jpg
dta-web | Not Found: /static/css/all.min.css
dta-web | Not Found: /static/css/bulma.min.css
dta-web | Not Found: /static/css/bulma-prefers-dark.css
dta-web | Not Found: /static/css/style.css
dta-web | Not Found: /static/js/navbar-toggle.js
dta-web | Not Found: /static/svg/logo.svg
dta-web | Not Found: /static/svg/clip-offline.svg
dta-web | Not Found: /media/game_thumbnails/510218.jpg
dta-web | Not Found: /static/svg/twitch.svg
dta-web | Not Found: /media/game_thumbnails/18122.jpg
dta-web | Not Found: /media/game_thumbnails/518184.jpg
dta-web | Not Found: /media/game_thumbnails/509658.jpg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.