Skip to content

Instantly share code, notes, and snippets.

@me-suzy
me-suzy / gaseste binar ce extensie au fisierele.py
Created September 14, 2024 12:09
gaseste binar ce extensie au fisierele
import os
import struct
def get_file_type(file_path):
with open(file_path, 'rb') as file:
header = file.read(4096) # Citim primii 4096 bytes pentru o analiză mai detaliată
# Verificăm semnături comune de fișiere
if header.startswith(b'\x89PNG\r\n\x1a\n'):
return 'image/png', '.png'
@me-suzy
me-suzy / find books google.py
Created September 14, 2024 09:14
find books google
#!/usr/bin/python3
import json
import requests
from bs4 import BeautifulSoup
import os
import pickle
from storeImages import StoreImages
from makePDF import createBook
import argparse
@me-suzy
me-suzy / Codul books.txt
Created September 14, 2024 09:10
Codul books.txt
C:\Users\necul>"c:\Users\necul\AppData\Local\Programs\Python\Python312\python.exe" "e:\Carte\BB\17 - Site Leadership\alte\Ionel Balauta\Aryeht\Task 1 - Traduce tot site-ul\Doar Google Web\Andreea\Meditatii\2023\Chome\GoBooDo-master\GoBooDo.py" --id 1wsYAAAAMAAJ
c:\Users\necul\AppData\Local\Programs\Python\Python312\Lib\site-packages\fpdf\__init__.py:39: UserWarning: You have both PyFPDF & fpdf2 installed. Both packages cannot be installed at the same time as they share the same module namespace. To only keep fpdf2, run: pip uninstall --yes pypdf && pip install --upgrade fpdf2
warnings.warn(
.88888. 888888ba 888888ba
d8' `88 88 `8b 88 `8b
88 .d8888b. a88aaaa8P' .d8888b. .d8888b. 88 88 .d8888b.
88 YP88 88' `88 88 `8b. 88' `88 88' `88 88 88 88' `88
Y8. .88 88. .88 88 .88 88. .88 88. .88 88 .8P 88. .88
`88888' `88888P' 88888888P `88888P' `88888P' 8888888P `88888P'
@me-suzy
me-suzy / download google books 3.py
Created September 14, 2024 07:38
download google books 3
import os
import urllib
import traceback
import regex as re
from time import sleep
from seleniumwire import webdriver # pip install selenium-wire
from progressbar import progressbar as bar
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service # <-- Import Service
@me-suzy
me-suzy / afdsfd.py
Created September 14, 2024 07:25
afdsfd.py
import os
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
# Opțiuni pentru Chrome
chrome_options = Options()
chrome_options.add_argument('--start-maximized')
# Inițializează driver-ul Chrome folosind Selenium Manager
@me-suzy
me-suzy / asfasf.py
Created September 14, 2024 07:22
asfasf.py
import os
import time
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
# Utilizarea Selenium Manager pentru a gestiona driverul corect
service = Service()
@me-suzy
me-suzy / download google books 2.py
Created September 14, 2024 07:18
download google books 2
import os
import time
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import NoSuchElementException
# Utilizarea Selenium Manager pentru a gestiona driverul corect
@me-suzy
me-suzy / google books html.txt
Created September 14, 2024 07:15
google books html.txt
<!doctype html><html lang="ro"><head><meta charset="UTF-8"><meta content="origin" name="referrer"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google Books</title><script nonce="_zMB-iGD9mW8xIGglGVBRg">window._hst=Date.now();performance&&performance.mark&&performance.mark("SearchHeadStart");</script><script nonce="_zMB-iGD9mW8xIGglGVBRg">(function(){var b=window.addEventListener;window.addEventListener=function(a,c,d){a!=="unload"&&b(a,c,d)};}).call(this);(function(){var _g={kEI:'ITblZs64CdX-7_UPi9ftoA4',kEXPI:'31',kBL:'dzg3',kOPI:89978449};(function(){var a;((a=window.google)==null?0:a.stvsc)?google.kEI=_g.kEI:window.google=_g;}).call(this);})();(function(){google.sn='web';google.kHL='ro';})();(function(){
var h=this||self;function l(){return window.google!==void 0&&window.google.kOPI!==void 0&&window.google.kOPI!==0?window.google.kOPI:null};var m,n=[];function p(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||m}
@me-suzy
me-suzy / Descarca doar prima pagina.py
Created September 14, 2024 06:54
Descarca doar prima pagina
import requests
from bs4 import BeautifulSoup
# URL-ul cărții de pe Google Books
url = 'https://www.google.ro/books/edition/Valori_clasice/1wsYAAAAMAAJ?hl=ro&gbpv=1'
# Trimite o cerere la URL
response = requests.get(url)
# Verifică dacă cererea a avut succes
@me-suzy
me-suzy / Download books.py
Created September 14, 2024 06:53
Download books
import os
import time # Adăugăm importul pentru modulul time
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
# Utilizarea Selenium Manager pentru a gestiona driverul corect
service = Service()