This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
captainVersion: 4 | |
services: | |
'$$cap_appname': | |
caproverExtra: | |
dockerfileLines: | |
- FROM alpine:3.16.2 | |
- RUN apk add --no-cache unzip openssh | |
- ADD https://github.com/pocketbase/pocketbase/releases/download/v$$cap_version/pocketbase_$$cap_version_$$cap_architecture.zip /tmp/pb.zip | |
- RUN unzip /tmp/pb.zip -d /pb/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { promises } from 'fs'; | |
const { writeFile, readFile, unlink, stat, mkdir } = promises; | |
import { join } from 'path'; | |
import { WAProto as proto, initAuthCreds, BufferJSON } from "@adiwajshing/baileys" | |
// import { proto } from "../../WAProto"; | |
// import { initAuthCreds } from "./auth-utils"; | |
// import { BufferJSON } from "./generics"; | |
export default async function useMultiFileAuthState(folder) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mysql.connector | |
from mysql.connector import errorcode | |
try: | |
db_connection = mysql.connector.connect(host='ip', user='root', password='senha', database='bd', port=32786) | |
print("Database connection made!") | |
except mysql.connector.Error as error: | |
if error.errno == errorcode.ER_BAD_DB_ERROR: | |
print("Database doesn't exist") | |
elif error.errno == errorcode.ER_ACCESS_DENIED_ERROR: | |
print("User name or password is wrong") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, json | |
url = 'http://url/2webp' | |
with open("video5.mp4", "rb") as file: | |
envia = requests.post(url, files = {"file": file}) | |
resposta = json.loads(envia.text) | |
print(resposta) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
b = os.path.getsize("c.gif") | |
tamanho = int((b/1024)/1024) | |
print(tamanho) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def youtube_url_validation(url): | |
youtube_regex = ( | |
r'(https?://)?(www\.)?' | |
'(youtube|youtu|youtube-nocookie)\.(com|be)/' | |
'(watch\?v=|embed/|v/|.+\?v=)?([^&=%\?]{11})') | |
youtube_regex_match = re.match(youtube_regex, url) | |
if youtube_regex_match: |