MCPcopy
hub / github.com/nsonaniya2010/SubDomainizer / PreCompiledRegexCloud

Function PreCompiledRegexCloud

SubDomainizer.py:425–471  ·  view source on GitHub ↗

This will create list of precompiled regex object to find cloud URLs within the content. Returns -------- list a list of precompiled regex objects.

()

Source from the content-addressed store, hash-verified

423
424
425def PreCompiledRegexCloud():
426 """
427
428 This will create list of precompiled regex object to find cloud URLs within the content.
429
430 Returns
431 --------
432 list
433 a list of precompiled regex objects.
434 """
435 cfreg = re.compile(r'([\w]+\.cloudfront\.net)',
436 re.MULTILINE | re.IGNORECASE)
437 gbureg = re.compile(r'([\w\-.]+\.appspot\.com)',
438 re.MULTILINE | re.IGNORECASE)
439 s3bucketreg = re.compile(
440 r'([\w\-.]*s3[\w\-.]*\.?amazonaws\.com/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
441 doreg = re.compile(
442 r'([\w\-.]*\.?digitaloceanspaces\.com/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
443 gsreg1 = re.compile(
444 r'(storage\.cloud\.google\.com/[\w\-.]+)', re.MULTILINE | re.IGNORECASE)
445 gsreg2 = re.compile(
446 r'([\w\-.]*\.?storage.googleapis.com/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
447 gsreg3 = re.compile(
448 r'([\w\-.]*\.?storage-download.googleapis.com/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
449 gsreg4 = re.compile(
450 r'([\w\-.]*\.?content-storage-upload.googleapis.com/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
451 gsreg5 = re.compile(
452 r'([\w\-.]*\.?content-storage-download.googleapis.com/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
453 azureg1 = re.compile(
454 r'([\w\-.]*\.?1drv\.com/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
455 azureg2 = re.compile(
456 r'(onedrive.live.com/[\w.\-]+)', re.MULTILINE | re.IGNORECASE)
457 azureg3 = re.compile(
458 r'([\w\-.]*\.?blob\.core\.windows\.net/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
459 rackcdnreg = re.compile(
460 r'([\w\-.]*\.?rackcdn.com/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
461 dreamhostreg1 = re.compile(
462 r'([\w\-.]*\.?objects\.cdn\.dream\.io/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
463 dreamhostreg2 = re.compile(
464 r'([\w\-.]*\.?objects-us-west-1.dream.io/?[\w\-.]*)', re.MULTILINE | re.IGNORECASE)
465 firebase = re.compile(r'([\w\-.]+\.firebaseio\.com)',
466 re.MULTILINE | re.IGNORECASE)
467
468 cloudlist = [cfreg, s3bucketreg, doreg, gsreg1, gsreg2, gsreg3, gsreg4, gsreg5,
469 azureg1, azureg2, azureg3, rackcdnreg, dreamhostreg1, dreamhostreg2, firebase, gbureg]
470
471 return cloudlist
472
473
474def PreCompiledRegexDomain(url):

Callers 1

SubDomainizer.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected