File size: 1,085 Bytes
c4e85f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import streamlit as st
import os
from git import Repo

# Display the title
st.title("AI Based Video Summary Tool")

# Use secret management for GitHub PAT
github_token = st.secrets["GITHUB_PAT"]
repo_url = st.text_input("https://github.com/NeeravSood/VST_HF")
local_dir = "repo"  # Directory to clone the repo into

# Clone the private repository
if st.button("Clone Repository"):
    if github_token and repo_url:
        try:
            # Use the provided token for authentication
            if repo_url.startswith("https://"):
                repo_url = repo_url.replace("https://", f"https://{github_token}@")
            
            Repo.clone_from(repo_url, local_dir)
            st.success("Repository cloned successfully!")
        except Exception as e:
            st.error(f"Error cloning repository: {e}")
    else:
        st.warning("Please provide the repository URL.")

# Display contents of the cloned repository
if os.path.exists(local_dir):
    files = os.listdir(local_dir)
    st.write("Files in the repository:")
    for file in files:
        st.write(file)