Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
Server for parse Media by URL.
Use the docker-compose.yml
file to run the server.
version: "3.8"
service:
media-parser:
image: ghcr.io/jag-k/media-parser:latest
ports:
- 8000:8000
environment:
# Sentry integration (optional)
SENTRY_DSN: "https://abcabc@sentry.io/2"
SENTRY_ENVIRONMENT: "dev"
# Enable sentry user feedback (optional)
SENTRY_ORGANISATION_SLUG: "sentry"
SENTRY_PROJECT_SLUG: "media-parser"
SENTRY_AUTH_TOKEN: "..." # with scope project:write
SENTRY_API_HOST: "https://api.sentry.io/"
# Database
MONGO_URL: "mongodb://mongodb:27017"
MONGO_DATABASE: "test"
volumes:
- ./config:/config
mongodb:
image: mongo:latest
volumes:
- ./data:/data/db
All configs for parsers stored in config/parsers.json
. JSON Schema for
this: schemas/parser_schema.json.
To enable parser, you need to add config for this parser.
If parser hasn't config, like tiktok
set an empty object ({}
) to enable it.
Example:
// config/parsers.json
{
"$schema": "https://raw.github.com/jag-k/media-parsers/blob/main/schemas/parser_schema.json",
"instagram": {
// Optional
"instagram_saas_token": "asdasd"
},
"reddit": {
"client_id": "",
"client_secret": "",
// Optional
"user_agent": "video downloader (by u/Jag_k)"
},
"tiktok": {},
"twitter": {
"twitter_bearer_token": "asdasd"
},
"youtube": {}
}
Or you can use YAML file like config/parsers.yaml
or config/parsers.yml
:
# config/parsers.yml
$schema: "https://raw.github.com/jag-k/media-parsers/blob/main/schemas/parser_schema.json"
instagram:
# Optional
instagram_saas_token: "asdasd"
reddit:
client_id: ""
client_secret: ""
# Optional
user_agent: "video downloader (by u/Jag_k)"
tiktok: {}
twitter:
twitter_bearer_token: "asdasd"
youtube: {}
API documentation available on /docs
endpoint.
poetry add media-parser # or pip install media-parser
from media_parser import Client, FeedbackTypes
client = Client(url="http://localhost:8000")
async def main():
# Get all media
media = await client.parse("https://www.youtube.com/watch?v=9bZkp7q19f0", user="jag-k")
print(media)
# If media is incorrect, you can send feedback
await client.send_feedback(media, "jag-k", FeedbackTypes.wrong_media)
if __name__ == '__main__':
import asyncio
asyncio.run(main())
FAQs
API for parsing media from social networks
We found that media-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.