This commit is contained in:
louiscklaw
2025-01-31 21:09:15 +08:00
parent fd583f2c63
commit 235b44cf96
34 changed files with 1017 additions and 0 deletions

View File

@@ -0,0 +1,157 @@
4887255340
[Tweet(id=1739151195732840940,
id_str='1739151195732840940',
url='https://twitter.com/LouiscklawLouis/status/1739151195732840940',
date=datetime.datetime(2023, 12, 25, 5, 8, 51, tzinfo=datetime.timezone.utc),
user=User(id=4887255340,
id_str='4887255340',
url='https://twitter.com/LouiscklawLouis',
username='LouiscklawLouis',
displayname='louis',
rawDescription='',
created=datetime.datetime(2016, 2, 8, 7, 23, 20, tzinfo=datetime.timezone.utc),
followersCount=1,
friendsCount=39,
statusesCount=3,
favouritesCount=0,
listedCount=0,
mediaCount=0,
location='',
profileImageUrl='https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png',
profileBannerUrl=None,
protected=None,
verified=False,
blue=False,
blueType=None,
descriptionLinks=[],
_type='snscrape.modules.twitter.User'),
lang='zxx',
rawContent='https://t.co/a0YX1eAmer',
replyCount=0,
retweetCount=0,
likeCount=0,
quoteCount=0,
conversationId=1739151195732840940,
hashtags=[],
cashtags=[],
mentionedUsers=[],
links=[TextLink(url='https://x.com/i/spaces/1LyGBnmdpejGN',
text='x.com/i/spaces/1LyGB…',
tcourl='https://t.co/a0YX1eAmer')],
viewCount=1,
retweetedTweet=None,
quotedTweet=None,
place=None,
coordinates=None,
inReplyToTweetId=None,
inReplyToUser=None,
source='<a href="http://twitter.com/download/android" '
'rel="nofollow">Twitter for Android</a>',
sourceUrl='http://twitter.com/download/android',
sourceLabel='Twitter for Android',
media=Media(photos=[], videos=[], animated=[]),
_type='snscrape.modules.twitter.Tweet'),
Tweet(id=1739150833206612066,
id_str='1739150833206612066',
url='https://twitter.com/LouiscklawLouis/status/1739150833206612066',
date=datetime.datetime(2023, 12, 25, 5, 7, 25, tzinfo=datetime.timezone.utc),
user=User(id=4887255340,
id_str='4887255340',
url='https://twitter.com/LouiscklawLouis',
username='LouiscklawLouis',
displayname='louis',
rawDescription='',
created=datetime.datetime(2016, 2, 8, 7, 23, 20, tzinfo=datetime.timezone.utc),
followersCount=1,
friendsCount=39,
statusesCount=3,
favouritesCount=0,
listedCount=0,
mediaCount=0,
location='',
profileImageUrl='https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png',
profileBannerUrl=None,
protected=None,
verified=False,
blue=False,
blueType=None,
descriptionLinks=[],
_type='snscrape.modules.twitter.User'),
lang='zxx',
rawContent='https://t.co/DveNOVgyy1',
replyCount=0,
retweetCount=0,
likeCount=0,
quoteCount=0,
conversationId=1739150833206612066,
hashtags=[],
cashtags=[],
mentionedUsers=[],
links=[TextLink(url='https://twitter.com/i/broadcasts/1lPKqbjXavEGb',
text='twitter.com/i/broadcasts/1…',
tcourl='https://t.co/DveNOVgyy1')],
viewCount=None,
retweetedTweet=None,
quotedTweet=None,
place=None,
coordinates=None,
inReplyToTweetId=None,
inReplyToUser=None,
source='<a href="http://twitter.com/download/android" '
'rel="nofollow">Twitter for Android</a>',
sourceUrl='http://twitter.com/download/android',
sourceLabel='Twitter for Android',
media=Media(photos=[], videos=[], animated=[]),
_type='snscrape.modules.twitter.Tweet'),
Tweet(id=1738999403795607942,
id_str='1738999403795607942',
url='https://twitter.com/LouiscklawLouis/status/1738999403795607942',
date=datetime.datetime(2023, 12, 24, 19, 5, 41, tzinfo=datetime.timezone.utc),
user=User(id=4887255340,
id_str='4887255340',
url='https://twitter.com/LouiscklawLouis',
username='LouiscklawLouis',
displayname='louis',
rawDescription='',
created=datetime.datetime(2016, 2, 8, 7, 23, 20, tzinfo=datetime.timezone.utc),
followersCount=1,
friendsCount=39,
statusesCount=3,
favouritesCount=0,
listedCount=0,
mediaCount=0,
location='',
profileImageUrl='https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png',
profileBannerUrl=None,
protected=None,
verified=False,
blue=False,
blueType=None,
descriptionLinks=[],
_type='snscrape.modules.twitter.User'),
lang='zxx',
rawContent='https://t.co/xGQZandc6E',
replyCount=0,
retweetCount=0,
likeCount=0,
quoteCount=0,
conversationId=1738999403795607942,
hashtags=[],
cashtags=[],
mentionedUsers=[],
links=[TextLink(url='https://twitter.com/i/broadcasts/1DXGyjnAQVeJM',
text='twitter.com/i/broadcasts/1…',
tcourl='https://t.co/xGQZandc6E')],
viewCount=2,
retweetedTweet=None,
quotedTweet=None,
place=None,
coordinates=None,
inReplyToTweetId=None,
inReplyToUser=None,
source='<a href="http://twitter.com/download/android" '
'rel="nofollow">Twitter for Android</a>',
sourceUrl='http://twitter.com/download/android',
sourceLabel='Twitter for Android',
media=Media(photos=[], videos=[], animated=[]),
_type='snscrape.modules.twitter.Tweet')]

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env python
import asyncio
from twscrape import API, gather
from twscrape.logger import set_log_level
async def main():
api = API()
# await api.pool.add_account("louiscklaw", "24p69gki", "louiscklaw@gmail.com", "24p69gki")
await api.pool.login_all()
user_login = "LouiscklawLouis"
user = await api.user_by_login(user_login)
print(user.id)
user_id = user.id
test_list = await gather(api.user_tweets(user_id, limit=5))
from pprint import pprint
pprint(test_list)
# get the link https://twitter.com/i/broadcasts/1DXGyjnAQVeJM
# process to to download
# get the link
# https://x.com/i/spaces/1LyGBnmdpejGN
# process
# print(test_list)
if __name__ == "__main__":
asyncio.run(main())

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -ex
# twscrape louiscklaw@gmail.com 24p69gki
# twscrape add_accounts ./accounts.txt louiscklaw:24p69gki:louiscklaw@gmail.com:24p69gki
twscrape add_accounts ./accounts.txt username:password:email:123321

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -ex
# https://twitter.com/i/spaces/1LyxBnmNkObxN
# twspace_dl -v -i https://twitter.com/i/spaces/1LyxBnmNkObxN -c cookies.txt
# https://twitter.com/i/spaces/1LyGBnmdpejGN/peek
twspace_dl -v -i https://twitter.com/i/spaces/1LyGBnmdpejGN -c cookies.txt
# pip install git+https://github.com/rly0nheart/twitter-video-downloader

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -ex
yt-dlp https://twitter.com/i/broadcasts/1OyKAWRYeOgJb

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python
import os,sys
from pprint import pprint
import requests
def send_message(webhook_url, message):
data = {
'content': message
}
response = requests.post(webhook_url, json=data)
if response.status_code == 204:
print('Message sent successfully.')
else:
print('Failed to send message.')
webhook_url = 'https://discord.com/api/webhooks/1188733135014350858/WMbHoxDuepmiJOifvIzMfxMzBF3AYTOEo9OaEM7QKFIj9sj0SeXnUOQd-rMO6KFMiirl'
message = "Hello, Discord!"
send_message(webhook_url, message)