offish / twitchtube

Twitch YouTube bot. Automatically make video compilations of the most viewed Twitch clips and upload them to YouTube using Python 3.
MIT License
538 stars 77 forks source link

Numbering in end of video titles & get latest clip #51

Closed ShivamThakkar1 closed 2 years ago

ShivamThakkar1 commented 3 years ago

In next update can you add youtube video titles numbering feature n For example gaming video 1 gaming video 2...3...4...n

also to get latest twitch clips instead of most view clips

PepNieto commented 3 years ago

I did something cheap it might work for u, on config.py u need to import those:

from __future__ import print_function
import atexit
from os import path
from json import dumps, loads

def read_counter():
    return loads(open("counter.json", "r").read()) + 1 if path.exists("counter.json") else 0

def write_counter():
    with open("counter.json", "w") as f:
        f.write(dumps(counter))

counter = read_counter()
atexit.register(write_counter)

and then in ur title u only need to add this
TITLE = "my title and many times i upload the content #{}".format(counter)

The problem with that is that i tried to put the name of the first clip and the count after it, but couldnt figure it out.

Anyways this repo is damn good, very well done.

Hope that helps you a bit.

offish commented 3 years ago

A numbering feature is too specific in my opinion, so I won't work on that, but feel free to add it yourself and open a PR. I'll look into adding "latest" as an option.