Esempio n. 1
0
    def drive_list(self, fileName):
        msg = ''
        INDEX = -1
        content_count = 0
        add_title_msg = True
        for parent_id in DRIVE_ID:
            response = self.drive_query(parent_id, fileName)
            INDEX += 1
            if response:
                if add_title_msg == True:
                    msg = f'<h3>Sᴇᴀʀᴄʜ Rᴇsᴜʟᴛs Fᴏʀ Yᴏᴜʀ Kᴇʏᴡᴏʀᴅ : {fileName}</h3><br><b><a href="https://telegram.dog/TVSERIESHOME">💖 JOIN SERIES HUB 💖</a></b> ||<b><a href="https://telegram.dog/MOVIECLUB_CHAT">📥 JOIN MOVIE CLUB 📥</a></b><br><br>'
                    add_title_msg = False
                msg += f"╾────────────╼<br><b>{DRIVE_NAME[INDEX]}</b><br>╾────────────╼<br>"
                for file in response:
                    if file.get(
                            'mimeType'
                    ) == "application/vnd.google-apps.folder":  # Detect Whether Current Entity is a Folder or File.
                        msg += f"🗃️<code>{file.get('name')}</code> <b>[Folder]</b><br>" \
                               f"<b><a href='https://drive.google.com/drive/folders/{file.get('id')}'>🌎G-Dʀɪᴠᴇ Lɪɴᴋ</a></b>"
                        if INDEX_URL[INDEX] is not None:
                            url_path = requests.utils.quote(
                                f'{file.get("name")}')
                            url = f'{INDEX_URL[INDEX]}/{url_path}/'
                            msg += f'<b> | <a href="{url}">📇Iɴᴅᴇx Lɪɴᴋ</a></b>'
                    else:
                        msg += f"🌀<code>{file.get('name')}</code> <b>({self.get_readable_file_size(file.get('size'))})</b><br>" \
                               f"<b><a href='https://drive.google.com/uc?id={file.get('id')}&export=download'>🌎G-Dʀɪᴠᴇ Lɪɴᴋ</a></b>"
                        if INDEX_URL[INDEX] is not None:
                            url_path = requests.utils.quote(
                                f'{file.get("name")}')
                            url = f'{INDEX_URL[INDEX]}/{url_path}'
                            msg += f'<b> | <a href="{url}">📇Iɴᴅᴇx Lɪɴᴋ</a></b>'
                    msg += '<br><br>'
                    content_count += 1
                    if content_count == TELEGRAPHLIMIT:
                        self.telegraph_content.append(msg)
                        msg = ""
                        content_count = 0

        if msg != '':
            self.telegraph_content.append(msg)

        if len(self.telegraph_content) == 0:
            return "<b>➼Nᴏ Rᴇsᴜʟᴛs Fᴏᴜɴᴅ Fᴏʀ Yᴏᴜʀ Fɪʟᴇ Nᴀᴍᴇ Kᴇʏᴡᴏʀᴅ :(</b>", None

        for content in self.telegraph_content:
            self.path.append(
                telegra_ph.create_page(title='☁️@DEV_BOTSS CLOUD☁️',
                                       html_content=content)['path'])

        self.num_of_path = len(self.path)
        if self.num_of_path > 1:
            self.edit_telegraph()

        msg = f" <b>Sᴇᴀʀᴄʜ Rᴇsᴜʟᴛs Fᴏʀ Yᴏᴜʀ Kᴇʏᴡᴏʀᴅ :</b> ➼ {fileName} 👇 "
        buttons = button_builder.ButtonMaker()
        buttons.buildbutton("☘️ CLICK HERE FOR FILE ☘️",
                            f"https://telegra.ph/{self.path[0]}")

        return msg, InlineKeyboardMarkup(buttons.build_menu(1))
Esempio n. 2
0
    def drive_list(self, fileName):
        msg = ""
        # Create Search Query for API request.
        query = f"'{parent_id}' in parents and (name contains '{fileName}')"
        response = self.__service.files().list(supportsTeamDrives=True,
                                               includeTeamDriveItems=True,
                                               q=query,
                                               spaces='drive',
                                               pageSize=200,
                                               fields='files(id, name, mimeType, size)',
                                               orderBy='modifiedTime desc').execute()

        if response["files"]:
            content_count = 0
            self.telegraph_content = []
            self.path = []
            msg += f'<h4>Results : {fileName}</h4><br>@Oreooo #Misaka<br><br>'

            for file in response.get('files', []):
                if file.get('mimeType') == "application/vnd.google-apps.folder":  # Detect Whether Current Entity is a Folder or File.
                    msg += f"⁍<code>{file.get('name')}<br>(folder📁)</code><br>" \
                           f"<b><a href='https://drive.google.com/drive/folders/{file.get('id')}'>Drive Link</a></b>"
                    if INDEX_URL is not None:
                        url_path = requests.utils.quote(f'{file.get("name")}')
                        url = f'{INDEX_URL}/{url_path}/'
                        msg += f' <b>| <a href="{url}">Index Link</a></b>'

                else:
                    msg += f"⁍<code>{file.get('name')}<br>({get_readable_file_size(int(file.get('size')))})📄</code><br>" \
                           f"<b><a href='https://drive.google.com/uc?id={file.get('id')}&export=download'>Drive Link</a></b>"
                    if INDEX_URL is not None:
                        url_path = requests.utils.quote(f'{file.get("name")}')
                        url = f'{INDEX_URL}/{url_path}'
                        msg += f' <b>| <a href="{url}">Index Link</a></b>'
                msg += '<br><br>'
                content_count += 1
                if content_count == TELEGRAPHLIMIT :
                    self.telegraph_content.append(msg)
                    msg = ""
                    content_count = 0

            if msg != '':
                self.telegraph_content.append(msg)

            for content in self.telegraph_content :
                self.path.append(telegra_ph.create_page(title = 'Misaka',
                                                html_content=content )['path'])

            self.num_of_path = len(self.path)      
            if self.num_of_path > 1:
                self.edit_telegraph()

            msg = f"<b>Search Results For {fileName} 👇</b>"
            buttons = button_builder.ButtonMaker()   
            buttons.buildbutton("HERE", f"https://telegra.ph/{self.path[0]}")

            return msg, InlineKeyboardMarkup(buttons.build_menu(1))

        else :
            return "No Result Found :(", None
Esempio n. 3
0
    def drive_list(self, fileName):
        msg = ''
        INDEX = -1
        content_count = 0
        add_title_msg = True
        for parent_id in DRIVE_ID:
            response = self.drive_query(parent_id, fileName)
            INDEX += 1
            if response:
                if add_title_msg == True:
                    msg = f'<h3>Search Results for : {fileName}</h3><br><br><h4>№Ÿ” To Get Access To Drive Links <a href="https://groups.google.com/g/gdrivemirrorcloud">№Ÿ‘‰Join Google Group</a></h4><br><br>'
                    add_title_msg = False
                msg += f"т•От”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т•М<br><b>{DRIVE_NAME[INDEX]}</b><br>т•От”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т•М<br>"
                for file in response:
                    if file.get(
                            'mimeType'
                    ) == "application/vnd.google-apps.folder":  # Detect Whether Current Entity is a Folder or File.
                        msg += f"№Ÿ“<code>{file.get('name')}</code> <b>(folder)</b><br>" \
                               f"<b><a href='https://drive.google.com/drive/folders/{file.get('id')}'>Drive Link</a></b>"
                        if INDEX_URL[INDEX] is not None:
                            url_path = requests.utils.quote(
                                f'{file.get("name")}')
                            url = f'{INDEX_URL[INDEX]}/{url_path}/'
                            msg += f'<b> | <a href="{url}">Index Link</a></b>'
                    else:
                        msg += f"№Ÿ“„<code>{file.get('name')}</code> <b>({self.get_readable_file_size(file.get('size'))})</b><br>" \
                               f"<b><a href='https://drive.google.com/uc?id={file.get('id')}&export=download'>Drive Link</a></b>"
                        if INDEX_URL[INDEX] is not None:
                            url_path = requests.utils.quote(
                                f'{file.get("name")}')
                            url = f'{INDEX_URL[INDEX]}/{url_path}'
                            msg += f'<b> | <a href="{url}">Index Link</a></b>'
                    msg += '<br><br>'
                    content_count += 1
                    if content_count == TELEGRAPHLIMIT:
                        self.telegraph_content.append(msg)
                        msg = ""
                        content_count = 0

        if msg != '':
            self.telegraph_content.append(msg)

        if len(self.telegraph_content) == 0:
            return "No Result Found :(", None

        for content in self.telegraph_content:
            self.path.append(
                telegra_ph.create_page(title='Gdrive Mirror Cloud',
                                       html_content=content)['path'])

        self.num_of_path = len(self.path)
        if self.num_of_path > 1:
            self.edit_telegraph()

        msg = f" Search Results For {fileName} №Ÿ‘‡ "
        buttons = button_builder.ButtonMaker()
        buttons.buildbutton("CLICK HERE", f"https://telegra.ph/{self.path[0]}")

        return msg, InlineKeyboardMarkup(buttons.build_menu(1))
Esempio n. 4
0
    def drive_list(self, fileName):
        msg = ''
        INDEX = -1
        content_count = 0
        add_title_msg = True
        for parent_id in DRIVE_ID :
            response = self.drive_query(parent_id, fileName)    
            INDEX += 1          
            if response:
                if add_title_msg == True:
                    msg = f'<h3>Search Results for : {fileName}</h3><br>@LoaderXbot #ProjektX<br><br>'
                    add_title_msg = False
                msg += f"╾────────────╼<br><b>{DRIVE_NAME[INDEX]}</b><br>╾────────────╼<br>"
                for file in response:
                    if file.get('mimeType') == "application/vnd.google-apps.folder":  # Detect Whether Current Entity is a Folder or File.
                        msg += f"�<code>{file.get('name')}</code> <b>(folder)</b><br>" \
                               f"<b><a href='https://drive.google.com/drive/folders/{file.get('id')}'>Drive Link</a></b>"
                        if INDEX_URL[INDEX] is not None:
                            url_path = "/".join([requests.utils.quote(n, safe='') for n in self.get_recursive_list(file, parent_id)])
                            url = f'{INDEX_URL[INDEX]}/{url_path}/'
                            msg += f'<b> | <a href="{url}">Index Link</a></b>'
                    else:
                        msg += f"📄<code>{file.get('name')}</code> <b>({self.get_readable_file_size(file.get('size'))})</b><br>" \
                               f"<b><a href='https://drive.google.com/uc?id={file.get('id')}&export=download'>Drive Link</a></b>"
                        if INDEX_URL[INDEX] is not None:
                            url_path = "/".join([requests.utils.quote(n, safe ='') for n in self.get_recursive_list(file, parent_id)])
                            url = f'{INDEX_URL[INDEX]}/{url_path}'
                            msg += f'<b> | <a href="{url}">Index Link</a></b>'
                    msg += '<br><br>'
                    content_count += 1
                    if content_count == TELEGRAPHLIMIT :
                       self.telegraph_content.append(msg)
                       msg = ""
                       content_count = 0

        if msg != '':
            self.telegraph_content.append(msg)

        if len(self.telegraph_content) == 0:
            return "No Result Found :(", None

        for content in self.telegraph_content :
            self.path.append(telegra_ph.create_page(title = 'LoaderX',
                                                html_content=content )['path'])

        self.num_of_path = len(self.path)      
        if self.num_of_path > 1:
            self.edit_telegraph()

        msg = f" Search Results For {fileName} 👇 "
        buttons = button_builder.ButtonMaker()   
        buttons.buildbutton("CLICK HERE", f"https://telegra.ph/{self.path[0]}")

        return msg, InlineKeyboardMarkup(buttons.build_menu(1))
Esempio n. 5
0
    def drive_list(self, fileName):
        msg = f'<h4>Search Results for : {fileName}</h4><br>@LoaderXbot #ProjektX<br><br>'
        # Create Search Query for API request.
        INDEX_ID = 0
        for parent_id in DRIVE_ID:
            query = f"'{parent_id}' in parents and (name contains '{fileName}')"
            response = self.__service.files().list(
                supportsTeamDrives=True,
                includeTeamDriveItems=True,
                q=query,
                spaces='drive',
                pageSize=100,
                fields='files(id, name, mimeType, size)',
                orderBy='modifiedTime desc').execute()
            index_url = INDEX_URL[INDEX_ID]
            INDEX_ID += 1
            msg += f"т•От”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т•М<br><b>Team Drive : {INDEX_ID}</b><br>т•От”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т”€т•М<br>"
            if response["files"]:
                for file in response.get('files', []):
                    if file.get(
                            'mimeType'
                    ) == "application/vnd.google-apps.folder":  # Detect Whether Current Entity is a Folder or File.
                        msg += f"№Ÿ“<code>{file.get('name')}</code> <b>(folder)</b><br>" \
                               f"<b><a href='https://drive.google.com/drive/folders/{file.get('id')}'>Drive Link</a></b>"
                        if index_url is not None:
                            url_path = requests.utils.quote(
                                f'{file.get("name")}')
                            url = f'{index_url}/{url_path}/'
                            msg += f' <b>| <a href="{url}">Index Link</a></b>'

                    else:
                        msg += f"№Ÿ“„<code>{file.get('name')}</code> <b>({self.get_readable_file_size(file.get('size'))})</b><br>" \
                               f"<b><a href='https://drive.google.com/uc?id={file.get('id')}&export=download'>Drive Link</a></b>"
                        if index_url is not None:
                            url_path = requests.utils.quote(
                                f'{file.get("name")}')
                            url = f'{index_url}/{url_path}'
                            msg += f' <b>| <a href="{url}">Index Link</a></b>'
                    msg += '<br><br>'
            else:
                msg += "т <code>No Results</code><br><br>"

        response = telegra_ph.create_page(title='LoaderX',
                                          author_name='svr666',
                                          author_url='https://t.me/svr666',
                                          html_content=msg)['path']

        msg = f"<b>Search Results For {fileName} №Ÿ‘‡</b>"
        buttons = button_builder.ButtonMaker()
        buttons.buildbutton("HERE", f"https://telegra.ph/{response}")

        return msg, InlineKeyboardMarkup(buttons.build_menu(1))