python3 extract.py <drive_image_url>
The ID as a string, Example :
python3 extract.py https://drive.google.com/file/d/0BwZFRt1DatLLZUt4eF94dFh1ZXJubUthenY3MVZERU5yeV9z/view\?usp\=sharing
Output : 0BwZFRt1DatLLZUt4eF94dFh1ZXJubUthenY3MVZERU5yeV9z
python3 extract.py <drive_image_url>
The ID as a string, Example :
python3 extract.py https://drive.google.com/file/d/0BwZFRt1DatLLZUt4eF94dFh1ZXJubUthenY3MVZERU5yeV9z/view\?usp\=sharing
Output : 0BwZFRt1DatLLZUt4eF94dFh1ZXJubUthenY3MVZERU5yeV9z
import sys, re | |
link = str(sys.argv[1]) | |
# extracts the unique ID of the image/file | |
x = re.search(r"\bd/\w+", link) | |
print(x.group()[2:]) |
I fixed that, thanks for your script :3
\bd\/\w+[^/]([A-Za-z0-9-_])*
I have an id like this:
When it extract:
Can you fix it pls ?