Giter Club home page Giter Club logo

Comments (10)

xenova avatar xenova commented on June 16, 2024

Sure I can add something like this! 👍

from chat-downloader.

artiction avatar artiction commented on June 16, 2024

Hi, I'm actually not sure what to do if the code becomes buggy after I tamper with it, so I'll just wait for the feature. Sorry to bother you, though.

from chat-downloader.

xenova avatar xenova commented on June 16, 2024

Hi, I'm actually not sure what to do if the code becomes buggy after I tamper with it, so I'll just wait for the feature. Sorry to bother you, though.

No worries. I am currently working on improving documentation (and some other improvements), but I will get to it as soon as possible. If you don't mind, can you take a look at #61 (comment)? Just so I can close that issue. Thanks!

from chat-downloader.

 avatar commented on June 16, 2024

I already posted this, but I'm not sure if I accidentally deleted my post or if there's a network bug.
I made this shell script to achieve what you're trying to do.

#!/bin/sh
channel="$1"

get_live_url() {
	_channel="$1"

	_video_code=$(youtube-dl --list-formats --playlist-end 1 "$_channel/live" | grep MPD)
	if [ -n "$_video_code" ]; then
		_url=${_video_code#*be] }
		_url="https://www.youtube.com/watch?v=${_url%:*}"
		echo "$_url"
	fi
}

while live_url=$(get_live_url "$channel"); do
	if [ -n "$live_url" ]; then
		chat_downloader "$live_url"
	else
		sleep 60
	fi
done

from chat-downloader.

artiction avatar artiction commented on June 16, 2024

Cool, I'll check it tomorrow, thanks for the reply!

from chat-downloader.

xenova avatar xenova commented on June 16, 2024

Great stuff @alnj 😃

This functionality has actually already been implemented in the docs branch and will be released as soon as possible. It currently works with a channel url/id (e.g. https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow or just UCSJ4gkVC6NrvII8umztf0Ow), and I will add support for custom urls shortly (e.g. https://www.youtube.com/c/chilledcow or https://www.youtube.com/user/xxx)

from chat-downloader.

artiction avatar artiction commented on June 16, 2024

@alnj I'll be honest, I have no idea how to work this script out, where should I put the channel / video url?
@xenova When is this gonna be ready? And will it work with only the channel url, like the next upcoming livestream will automatically be saved? If yes, that sounds like the perfect feature for me, so thank you.

from chat-downloader.

xenova avatar xenova commented on June 16, 2024

I am quite busy during the week with university work, so I can only continue working on it over the weekend. I will try get it included as soon as possible.

from chat-downloader.

 avatar commented on June 16, 2024

@artiction I initially made it for myself so it's a shell script that won't work on Windows (not sure what OS you're using).
After making it executable with chmod +x filename.sh you can call it with ./filename.sh [channel URL goes here]. This will run continuously, running chat_downloader on every public video, but you can also make it run on just the next one if you add a break or return in a new line after the chat_downloader line.

from chat-downloader.

xenova avatar xenova commented on June 16, 2024

Sorry for the long wait... but I finally got around to adding this to the latest version (it was in the beta for the past few months).

You can now use the channel id of a user to search for live streams. If they are not streaming (i.e., no upcoming live stream or ongoing live stream), you will get the following message:

[INFO] There are no active or upcoming livestreams with a live chat. Retrying again in 30 seconds.

For example,

$ python -m chat_downloader https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw
[INFO] Site: youtube.com
[INFO] Retrieving chat for "UC-lHJZR3Gqxm24_Vd_AJ5Yw".
[INFO] There are no active or upcoming livestreams with a live chat. Retrying again in 30 seconds.

Every 30 seconds, it retries and once the channel goes live, the chat will be captured.

Let me know if you have any further questions! 😃

from chat-downloader.

Related Issues (20)

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.