Youtube流赞

  • x8_227124
    了解作者
  • 42.4KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-05 07:01
    上传日期
Youtube流赞 这是一个使用python的项目,它通过具有通道ID的文件进行查找,并检查该通道中的流是否处于活动状态。 如果有流,脚本将喜欢视频,并在环境变量中带有电子邮件和密码。 注意(项目状态) 该项目目前正处于创建GUI的阶段,尽管由于学校和我想要做的其他项目,我可能在接下来的几周没有足够的时间来完成它。 到目前为止,该程序已经根据我最初的计划完成了,但是如果我想了解GUI,将来可能会再次使用。 如何使用? 在编写代码之前: 将YSL.py文件复制到您的存储库中。 1.(使用YSL.py文件) 创建类StreamLiker的实例,并在文本文件中传递您要检查的频道的频道ID,电子邮件以及您的youtube帐户的密码。 例子: from YSL import StreamLiker email = 'email@test.com' passwd = 'qwerty' c_id
Youtube-stream-liker-main.zip
  • Youtube-stream-liker-main
  • liker_gui.py
    678B
  • LICENSE
    1KB
  • channel ids.txt
    2.1KB
  • Stream data
  • stream_data 01-28-21.csv
    1.3KB
  • stream_data 02-05-21.csv
    1.3KB
  • stream_data 01-18-21.csv
    1.3KB
  • stream_data 01-29-21.csv
    1.1KB
  • stream_data 01-13-21.csv
    1.1KB
  • stream_data 02-01-21.csv
    1.1KB
  • stream_data 02-09-21.csv
    1.8KB
  • stream_data 01-25-21.csv
    1.1KB
  • stream_data 01-27-21.csv
    851B
  • stream_data 02-08-21.csv
    1.2KB
  • stream_data 01-14-21.csv
    1.3KB
  • stream_data 01-21-21.csv
    1.4KB
  • stream_data 01-19-21.csv
    1.1KB
  • stream_data 02-04-21.csv
    1.2KB
  • stream_data 01-17-21.csv
    1.2KB
  • stream_data 01-11-21.csv
    1.5KB
  • stream_data 02-12-21.csv
    937B
  • stream_data 02-07-21.csv
    1.3KB
  • stream_data 01-31-21.csv
    1.4KB
  • stream_data 01-15-21.csv
    1.4KB
  • stream_data 01-16-21.csv
    1.2KB
  • stream_data 01-30-21.csv
    1.2KB
  • stream_data 01-26-21.csv
    1.1KB
  • stream_data 01-23-21.csv
    838B
  • stream_data 02-06-21.csv
    1.2KB
  • stream_data 02-03-21.csv
    1.3KB
  • stream_data 02-02-21.csv
    1.4KB
  • stream_data 02-11-21.csv
    1.5KB
  • stream_data 01-20-21.csv
    1.1KB
  • stream_data 01-12-21.csv
    1.1KB
  • stream_data 02-10-21.csv
    1.6KB
  • stream_data 01-22-21.csv
    1.2KB
  • stream_data 01-24-21.csv
    1.4KB
  • .gitignore
    138B
  • YSL.py
    9.3KB
  • README.md
    4.9KB
内容介绍
# Youtube-stream-liker This is a project using python which looks through a file with channel IDs and checks whether a stream from that channel is active or not. If there is a stream, the script will like the video with the email and password in the environment variables. ## Note(Project Status) The project is now currently on the phase of creating a GUI, although I may not have enough time to do it in the coming weeks because of school and other side projects that I want to do. As of now, the program is already complete based on what I had originally planned, though I might pick this up again in the future if I want to learn about GUIs. ## How is it used? ### Before making the code: Copy the YSL.py file into your repository. ### 1. (Using the YSL.py File) Create an instance of the class StreamLiker, and pass in the text file for the channel ids of the channels you want checked, the email, and then the password of your youtube account. Example: ``` python from YSL import StreamLiker email = 'email@test.com' passwd = 'qwerty' c_id = 'channels id.txt' sl = StreamLiker(c_id, email, passwd) ``` ### 2. To start liking active streams, we first have to check if the channels that we supplied are currently streaming. To check, we can call the is_streaming() method. Example: ``` python sl.is_streaming() ``` This will store the channel ids of the currently streaming channels on a dictionary. ### 3. In order to like the stream, we first need to get the video links of the streams. This is when we call get_stream_links() method. Example: ``` python sl.get_stream_links() ``` This will also store the links in a dictionary. ### 4. Now that we have the video links, we will now like them using a selenium webdriver. Simply call the method like_videos() to get started. Example: ``` python sl.like_videos() ``` And with that, the streams of the youtubers that you want to like can now be done automatically. The user can then tinker with the code, like putting the above block of code into a for loop so that the script will regularly check the provided channels whether they are streaming or not. ### 5. (OPTIONAL) For math nerds(I'm not one of them but I certainly will try to become one), there are additional methods that will let you use some data from the process of liking the video for the programmer to analyze. The data that are collected by the methods above are the number of active streams and number of streams that you liked for a single execution of the program. The additional methods that are within the program is get_start_time(), get_end_time(), append_data_on_file(), and append_data_on_db(). *get_start_time* and *get_end_time* will, as their name says, get the starting time and the ending time of the liking process. The recommended placement of *get_start_time* is before the *get_channels* method, and the placement for the *get_end_time* is after the *like_videos* method. Example: ```python from YSL import StreamLiker email = 'email@test.com' passwd = 'qwerty' c_id = 'channels id.txt' sl = StreamLiker(c_id, email, passwd) sl.get_start_time() sl.is_streaming() sl.get_stream_links() sl.like_videos() sl.get_end_time() ``` *append_data_on_file* takes all the data collected by the program and then stores it in a csv file. (Note: A folder named "Stream data" must be created first in order for this method to work.) Example: ``` python sl.append_data_on_file() ``` *append_data_on_db* takes all the data collected by the program and then stores it in your local database through mysql. The method needs the following arguments: user, host, password, database As of the moment, the user of this program might have to configure the code inside the *append_data_on_db* method in order to select the table on which the user will append the data to. ```python def append_data_on_db(self, user, host, passwd, database): tel = self.stream_data["Time elapsed"] nas = self.stream_data["No. of active streams"] nls = self.stream_data["No. of to-be-liked streams"] ts = self.stream_data["Time Started"] te = self.stream_data["Time Ended"] d = self.date db = mysql.connector.connect( user=user, host=host, passwd=passwd, database=database ) my_cursor = db.cursor() my_cursor.execute("INSERT INTO [PUT TABLE NAME HERE](Time_Elapsed, Num_active_streams, Num_liked_streams, Time_Started, Time_Ended, Date) VALUES(%s,%s,%s,%s,%s,%s)", (tel, nas, nls, ts, te, d)) db.commit() ``` The user can then use the method normally. Example: ```python user = 'root' host = 'localhost' passwd = 'root' database = 'YSL' sl.append_data_on_db(user=user, host=host, passwd=passwd, database=database) ``` ## Libraries Used -Selenium, requests, os, random, time, collections ## Contribution Any ideas related to a youtube video will be entertained and implemented in the code if decided. For the code, I will be doing it myself but others can suggest ideas on how to do it. ## License [MIT](https://choosealicense.com/licenses/mit/)
评论
    相关推荐
    • python
      Python 这是用于大多数基本和简单python代码的示例模板的存储库。
    • pythonpython ejercicies存储
      Python 这是我的python项目和练习库。 我很高兴与其他人分享我的工作,并且很乐意听到修复程序的选项。
    • Python
      这是我用Python编写的所有代码的存储库。创建此回购协议纯粹是出于透明目的和自我学习。 此处的所有代码仅供参考,仅供其他人参考以了解其实现。不要使用此存储库直接复制代码,而要与您的代码进行比较。 如果您对...
    • Python:Python存储
      Python 分享我所有的python项目! 游戏 *猜数字*蛇(未完成) *岩纸剪刀(未完成) 其他 *模拟时钟* Opencv辅助AI训练图像修改器 例子 时间表: *每确定一次将执行python代码的时间。
    • basic_training:一个存储python基本文本的存储
      基础训练 一个存储python基本文本的存储
    • python_template:Python存储
      Python存储库模板。 在此存储库中的所有文件中搜索PYTHON_TEMPLATE并将其替换为真实的项目名称。 和Release-Candidate如果你不是我:D 将CODECOV_SECRET设置为Codecov令牌。 将PIP_TOKEN设置为PyPI令牌。 徽章 ...
    • pycode:用于存储python代码示例和utils的仓库
      密码 用于存储python代码示例和utils的回购将更多文本添加到自述文件
    • Python_Pro_Bootcamp:该存储库将存储Python Pro Bootcam代码
      Python_Pro_Bootcamp 该存储库将存储Python Pro Bootcam代码。
    • python
      任何想要学习python细节的人,以下存储库都可以帮助他们以一种简单的方式进行理解。 知识库按主题明智地提供了示例的完整列表,并带有详细的说明。 注释所有示例,并取消注释并执行它们。 该存储库提供了python示例...
    • Python
      Python存储库包含与Python编程研究相关的文档