├── .eslintrc.json
├── .github
└── FUNDING.yml
├── .gitignore
├── .vscode
└── settings.json
├── README.md
├── index.d.ts
├── next.config.js
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── next.svg
├── thirteen.svg
└── vercel.svg
├── src
├── Components
│ ├── Converter
│ │ ├── Converter.tsx
│ │ ├── SpotifytoYT
│ │ │ ├── CreateYTPlaylist.tsx
│ │ │ ├── SearchSongsOnYT.tsx
│ │ │ └── SpotifytoYT.tsx
│ │ └── YTtoSpotify
│ │ │ ├── CreateSpotifyPlaylist.tsx
│ │ │ ├── SearchSongsOnSpotify.tsx
│ │ │ └── YTtoSpotify.tsx
│ ├── Onboarding
│ │ ├── GoogleLogin.tsx
│ │ ├── LandingPage.tsx
│ │ └── SpotifyLogin.tsx
│ ├── SignOut.tsx
│ ├── resources
│ │ └── images
│ │ │ ├── g-logo.png
│ │ │ └── yt-logo.png
│ └── utils
│ │ └── utilsFunctions.ts
├── app
│ ├── contextProvider.tsx
│ ├── converter
│ │ └── page.tsx
│ ├── globals.css
│ ├── googleLogin
│ │ └── page.tsx
│ ├── layout.tsx
│ ├── page.tsx
│ ├── privacyPolicy
│ │ └── page.tsx
│ ├── sessionProvider.tsx
│ └── spotifyLogin
│ │ └── page.tsx
├── hooks
│ ├── useRefreshSpotifyToken.tsx
│ └── useSpotify.tsx
└── pages
│ └── api
│ ├── auth
│ └── [...nextauth].js
│ └── spotify
│ └── getSpotifySongs
│ └── index.ts
├── tailwind.config.js
└── tsconfig.json
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: anonthedev
2 | buy_me_a_coffee: anonthedev
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 | .pnpm-debug.log*
27 |
28 | # local env files
29 | .env*.local
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "typescript.tsdk": "node_modules\\typescript\\lib",
3 | "typescript.enablePromptUseWorkspaceTsdk": true
4 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2 |
3 | ## Getting Started
4 |
5 | First, run the development server:
6 |
7 | ```bash
8 | npm run dev
9 | # or
10 | yarn dev
11 | # or
12 | pnpm dev
13 | ```
14 |
15 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
16 |
17 | You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
18 |
19 | [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
20 |
21 | The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
22 |
23 | This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
24 |
25 | ## Learn More
26 |
27 | To learn more about Next.js, take a look at the following resources:
28 |
29 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
30 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
31 |
32 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
33 |
34 | ## Deploy on Vercel
35 |
36 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
37 |
38 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
39 |
--------------------------------------------------------------------------------
/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module "next-auth/react"
--------------------------------------------------------------------------------
/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | experimental: {
4 | appDir: true,
5 | },
6 | }
7 |
8 | module.exports = nextConfig
9 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "youify-next",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "@types/node": "18.15.5",
13 | "@types/react": "18.0.28",
14 | "@types/react-dom": "18.0.11",
15 | "@vercel/analytics": "^1.0.0",
16 | "axios": "^1.3.6",
17 | "eslint": "8.36.0",
18 | "eslint-config-next": "14.1.0",
19 | "next": "13.2.4",
20 | "next-auth": "^4.24.5",
21 | "react": "18.2.0",
22 | "react-dom": "18.2.0",
23 | "spotify-web-api-node": "^5.0.2",
24 | "typescript": "5.3.3"
25 | },
26 | "devDependencies": {
27 | "@tailwindcss/typography": "^0.5.9",
28 | "@types/spotify-web-api-node": "^5.0.7",
29 | "autoprefixer": "^10.4.14",
30 | "postcss": "^8.4.23",
31 | "tailwindcss": "^3.3.1"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/public/next.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/thirteen.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Components/Converter/Converter.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import { useState, useContext, useEffect } from "react";
4 | import { GlobalContext } from "@/app/contextProvider";
5 | import YTtoSpotify from "./YTtoSpotify/YTtoSpotify";
6 | import SpotifytoYT from "./SpotifytoYT/SpotifytoYT";
7 | import axios from "axios";
8 | import useRefreshSpotifyToken from "@/hooks/useRefreshSpotifyToken";
9 | import SignOut from "../SignOut";
10 | import { useSession } from "next-auth/react";
11 | import { redirect } from "next/navigation";
12 |
13 | export default function Converter() {
14 | const { status, data: session } = useSession();
15 | const currentDate = Date.now();
16 | const refreshSpotifyToken = useRefreshSpotifyToken();
17 | const [WhatToWhat, setWhatToWhat] = useState(["YouTube", "Spotify"]);
18 | const [From, setFrom] = useState("YouTube");
19 | const [To, setTo] = useState("Spotify");
20 | const context = useContext(GlobalContext);
21 |
22 | const LSAvailable = typeof window !== "undefined";
23 | const spotifyToken = LSAvailable
24 | ? localStorage.getItem("spotifyAccessToken")
25 | : {};
26 | context.setSpotifyGlobalToken(spotifyToken);
27 |
28 | useEffect(() => {
29 | if (LSAvailable && session) {
30 | if (
31 | status === "unauthenticated" &&
32 | !localStorage.getItem("spotifyAccessToken")
33 | ) {
34 | redirect("/");
35 | }
36 | }
37 | });
38 |
39 | useEffect(() => {
40 | function getUserIdSpotify() {
41 | var userParams = {
42 | method: "GET",
43 | headers: {
44 | Accept: "application/json",
45 | "Content-Type": "application/json",
46 | Authorization: "Bearer " + localStorage.getItem("spotifyAccessToken"),
47 | },
48 | };
49 |
50 | axios
51 | .get("https://api.spotify.com/v1/me", userParams)
52 | .then((resp) => {
53 | // console.log(resp.data.id);
54 | context.setUserId(resp.data.id);
55 | // console.log("X");
56 | // navigate("/googleLogin");
57 | })
58 | .catch((err) => {
59 | console.log(err);
60 | });
61 | }
62 | if (LSAvailable) {
63 | const spotifyTokenExpireDate = new Date(
64 | localStorage.getItem("spotifyTokenExpire")!
65 | );
66 | // console.log(typeof currentDate)
67 | if (new Date(currentDate) >= spotifyTokenExpireDate) {
68 | refreshSpotifyToken;
69 | } else if (new Date(currentDate) < spotifyTokenExpireDate) {
70 | getUserIdSpotify();
71 | } else {
72 | getUserIdSpotify();
73 | }
74 | }
75 | });
76 |
77 | // console.log(WhatToWhat);
78 | return (
79 |
77 | Please set Playlist name 78 |
79 |37 | Make your playlists travel. 38 |
39 |Step 2 of 2
59 |60 | Google authentication is required for converting Spotify playlists to 61 | YouTube and also is useful to retrieve private playlists. 62 |
63 |29 | Ship your playlists from{" "} 30 | Spotify to{" "} 31 | YouTube and vice versa with 32 | Youify 33 |
34 |154 | Convert your YouTube playlist to Spotify in seconds. 155 |
156 |Step 1 of 2
173 |174 | Spotify needs authentication for even the most basic features hence 175 | you will have to login from both Spotify and Google 176 |
177 |Google Project Number: 79450447307
6 | 7 |Last updated: March 13, 2023
9 |10 | This Privacy Policy describes Our policies and procedures on the 11 | collection, use and disclosure of Your information when You use the 12 | Service and tells You about Your privacy rights and how the law 13 | protects You. 14 |
15 |16 | We use Your Personal data to provide and improve the Service. By using 17 | the Service, You agree to the collection and use of information in 18 | accordance with this Privacy Policy. 19 |
20 |23 | The words of which the initial letter is capitalized have meanings 24 | defined under the following conditions. The following definitions 25 | shall have the same meaning regardless of whether they appear in 26 | singular or in plural. 27 |
28 |For the purposes of this Privacy Policy:
30 |33 | Account means a unique account created for You to 34 | access our Service or parts of our Service. 35 |
36 |39 | Affiliate means an entity that controls, is 40 | controlled by or is under common control with a party, where 41 | "control" means ownership of 50% or more of the shares, 42 | equity interest or other securities entitled to vote for election 43 | of directors or other managing authority. 44 |
45 |48 | Company (referred to as either "the 49 | Company", "We", "Us" or "Our" 50 | in this Agreement) refers to Youify. 51 |
52 |55 | Cookies are small files that are placed on Your 56 | computer, mobile device or any other device by a website, 57 | containing the details of Your browsing history on that website 58 | among its many uses. 59 |
60 |63 | Country refers to: Bihar, India 64 |
65 |68 | Device means any device that can access the 69 | Service such as a computer, a cellphone or a digital tablet. 70 |
71 |74 | Personal Data is any information that relates to 75 | an identified or identifiable individual. 76 |
77 |80 | Service refers to the Website. 81 |
82 |85 | Service Provider means any natural or legal 86 | person who processes the data on behalf of the Company. It refers 87 | to third-party companies or individuals employed by the Company to 88 | facilitate the Service, to provide the Service on behalf of the 89 | Company, to perform services related to the Service or to assist 90 | the Company in analyzing how the Service is used. 91 |
92 |95 | Third-party Social Media Service refers to any 96 | website or any social network website through which a User can log 97 | in or create an account to use the Service. 98 |
99 |102 | Usage Data refers to data collected 103 | automatically, either generated by the use of the Service or from 104 | the Service infrastructure itself (for example, the duration of a 105 | page visit). 106 |
107 |110 | Website refers to Youify, accessible from 111 | 116 | youify.xyz 117 | 118 |
119 |122 | You means the individual accessing or using the 123 | Service, or the company, or other legal entity on behalf of which 124 | such individual is accessing or using the Service, as applicable. 125 |
126 |132 | While using Our Service, We may ask You to provide Us with certain 133 | personally identifiable information that can be used to contact or 134 | identify You. Personally identifiable information may include, but is 135 | not limited to: 136 |
137 |Usage Data is collected automatically when using the Service.
142 |143 | Usage Data may include information such as Your Device's Internet 144 | Protocol address (e.g. IP address), browser type, browser version, the 145 | pages of our Service that You visit, the time and date of Your visit, 146 | the time spent on those pages, unique device identifiers and other 147 | diagnostic data. 148 |
149 |150 | When You access the Service by or through a mobile device, We may 151 | collect certain information automatically, including, but not limited 152 | to, the type of mobile device You use, Your mobile device unique ID, 153 | the IP address of Your mobile device, Your mobile operating system, 154 | the type of mobile Internet browser You use, unique device identifiers 155 | and other diagnostic data. 156 |
157 |158 | We may also collect information that Your browser sends whenever You 159 | visit our Service or when You access the Service by or through a 160 | mobile device. 161 |
162 |163 | We use YouTube API to create a playlist in your account and then add 164 | some videos to that playlist. You will be able to see which videos we 165 | are going to add to the playlist. 166 |
167 |169 | The Company allows You to create an account and log in to use the 170 | Service through the following Third-party Social Media Services: 171 |
172 |177 | This application uses YouTube API. 178 |
179 | 180 |181 | By using this application you are also being bound to YouTube terms of 182 | services Youtube TOS 183 |
184 | 185 |186 | If You decide to register through or otherwise grant us access to a 187 | Third-Party Social Media Service, We may collect Personal data that is 188 | already associated with Your Third-Party Social Media Service's 189 | account, such as Your name, Your email address, Your activities or 190 | Your contact list associated with that account. 191 |
192 |193 | You may also have the option of sharing additional information with 194 | the Company through Your Third-Party Social Media Service's account. 195 | If You choose to provide such information and Personal Data, during 196 | registration or otherwise, You are giving the Company permission to 197 | use, share, and store it in a manner consistent with this Privacy 198 | Policy. 199 |
200 | 201 |202 | Reference to Google Privacy Policy - 203 | 204 | Google privacy policy 205 | 206 |
207 |209 | We use Cookies and similar tracking technologies to track the activity 210 | on Our Service and store certain information. Tracking technologies 211 | used are beacons, tags, and scripts to collect and track information 212 | and to improve and analyze Our Service. The technologies We use may 213 | include: 214 |
215 |235 | Cookies can be "Persistent" or "Session" Cookies. 236 | Persistent Cookies remain on Your personal computer or mobile device 237 | when You go offline, while Session Cookies are deleted as soon as You 238 | close Your web browser. Learn more about cookies on the 239 | 243 | Free Privacy Policy website 244 | 245 | article. 246 |
247 |248 | We use both Session and Persistent Cookies for the purposes set out 249 | below: 250 |
251 |254 | Necessary / Essential Cookies 255 |
256 |Type: Session Cookies
257 |Administered by: Us
258 |259 | Purpose: These Cookies are essential to provide You with services 260 | available through the Website and to enable You to use some of its 261 | features. They help to authenticate users and prevent fraudulent 262 | use of user accounts. Without these Cookies, the services that You 263 | have asked for cannot be provided, and We only use these Cookies 264 | to provide You with those services. 265 |
266 |269 | Cookies Policy / Notice Acceptance Cookies 270 |
271 |Type: Persistent Cookies
272 |Administered by: Us
273 |274 | Purpose: These Cookies identify if users have accepted the use of 275 | cookies on the Website. 276 |
277 |280 | Functionality Cookies 281 |
282 |Type: Persistent Cookies
283 |Administered by: Us
284 |285 | Purpose: These Cookies allow us to remember choices You make when 286 | You use the Website, such as remembering your login details or 287 | language preference. The purpose of these Cookies is to provide 288 | You with a more personal experience and to avoid You having to 289 | re-enter your preferences every time You use the Website. 290 |
291 |294 | For more information about the cookies we use and your choices 295 | regarding cookies, please visit our Cookies Policy or the Cookies 296 | section of our Privacy Policy. 297 |
298 |The Company may use Personal Data for the following purposes:
300 |303 | We use YouTube API to create a playlist in your 304 | account and then add some videos to that playlist. You will be 305 | able to see which videos we are going to add to the playlist. 306 |
307 |310 | To provide and maintain our Service, including to 311 | monitor the usage of our Service. 312 |
313 |316 | To manage Your Account: to manage Your 317 | registration as a user of the Service. The Personal Data You 318 | provide can give You access to different functionalities of the 319 | Service that are available to You as a registered user. 320 |
321 |324 | For the performance of a contract: the 325 | development, compliance and undertaking of the purchase contract 326 | for the products, items or services You have purchased or of any 327 | other contract with Us through the Service. 328 |
329 |332 | To contact You: To contact You by email, 333 | telephone calls, SMS, or other equivalent forms of electronic 334 | communication, such as a mobile application's push notifications 335 | regarding updates or informative communications related to the 336 | functionalities, products or contracted services, including the 337 | security updates, when necessary or reasonable for their 338 | implementation. 339 |
340 |343 | To provide You with news, special offers and 344 | general information about other goods, services and events which 345 | we offer that are similar to those that you have already purchased 346 | or enquired about unless You have opted not to receive such 347 | information. 348 |
349 |352 | To manage Your requests: To attend and manage 353 | Your requests to Us. 354 |
355 |358 | For business transfers: We may use Your 359 | information to evaluate or conduct a merger, divestiture, 360 | restructuring, reorganization, dissolution, or other sale or 361 | transfer of some or all of Our assets, whether as a going concern 362 | or as part of bankruptcy, liquidation, or similar proceeding, in 363 | which Personal Data held by Us about our Service users is among 364 | the assets transferred. 365 |
366 |369 | For other purposes: We may use Your information 370 | for other purposes, such as data analysis, identifying usage 371 | trends, determining the effectiveness of our promotional campaigns 372 | and to evaluate and improve our Service, products, services, 373 | marketing and your experience. 374 |
375 |378 | We may share Your personal information in the following situations: 379 |
380 |422 | The Company will retain Your Personal Data only for as long as is 423 | necessary for the purposes set out in this Privacy Policy. We will 424 | retain and use Your Personal Data to the extent necessary to comply 425 | with our legal obligations (for example, if we are required to retain 426 | your data to comply with applicable laws), resolve disputes, and 427 | enforce our legal agreements and policies. 428 |
429 |430 | The Company will also retain Usage Data for internal analysis 431 | purposes. Usage Data is generally retained for a shorter period of 432 | time, except when this data is used to strengthen the security or to 433 | improve the functionality of Our Service, or We are legally obligated 434 | to retain this data for longer time periods. 435 |
436 |438 | Your information, including Personal Data, is processed at the 439 | Company's operating offices and in any other places where the parties 440 | involved in the processing are located. It means that this information 441 | may be transferred to — and maintained on — computers located outside 442 | of Your state, province, country or other governmental jurisdiction 443 | where the data protection laws may differ than those from Your 444 | jurisdiction. 445 |
446 |447 | Your consent to this Privacy Policy followed by Your submission of 448 | such information represents Your agreement to that transfer. 449 |
450 |451 | The Company will take all steps reasonably necessary to ensure that 452 | Your data is treated securely and in accordance with this Privacy 453 | Policy and no transfer of Your Personal Data will take place to an 454 | organization or a country unless there are adequate controls in place 455 | including the security of Your data and other personal information. 456 |
457 |460 | You can revoke permission for this application 461 | 466 | {" "} 467 | here 468 | 469 |
470 | 471 |472 | You have the right to delete or request that We assist in deleting the 473 | Personal Data that We have collected about You. 474 |
475 |476 | Our Service may give You the ability to delete certain information 477 | about You from within the Service. 478 |
479 |480 | You may update, amend, or delete Your information at any time by 481 | signing in to Your Account, if you have one, and visiting the account 482 | settings section that allows you to manage Your personal information. 483 | You may also contact Us to request access to, correct, or delete any 484 | personal information that You have provided to Us. 485 |
486 |487 | Please note, however, that We may need to retain certain information 488 | when we have a legal obligation or lawful basis to do so. 489 |
490 |493 | If the Company is involved in a merger, acquisition or asset sale, 494 | Your Personal Data may be transferred. We will provide notice before 495 | Your Personal Data is transferred and becomes subject to a different 496 | Privacy Policy. 497 |
498 |500 | Under certain circumstances, the Company may be required to disclose 501 | Your Personal Data if required to do so by law or in response to valid 502 | requests by public authorities (e.g. a court or a government agency). 503 |
504 |506 | The Company may disclose Your Personal Data in the good faith belief 507 | that such action is necessary to: 508 |
509 |523 | The security of Your Personal Data is important to Us, but remember 524 | that no method of transmission over the Internet, or method of 525 | electronic storage is 100% secure. While We strive to use commercially 526 | acceptable means to protect Your Personal Data, We cannot guarantee 527 | its absolute security. 528 |
529 |531 | Our Service does not address anyone under the age of 13. We do not 532 | knowingly collect personally identifiable information from anyone 533 | under the age of 13. If You are a parent or guardian and You are aware 534 | that Your child has provided Us with Personal Data, please contact Us. 535 | If We become aware that We have collected Personal Data from anyone 536 | under the age of 13 without verification of parental consent, We take 537 | steps to remove that information from Our servers. 538 |
539 |540 | If We need to rely on consent as a legal basis for processing Your 541 | information and Your country requires consent from a parent, We may 542 | require Your parent's consent before We collect and use that 543 | information. 544 |
545 |547 | Our Service may contain links to other websites that are not operated 548 | by Us. If You click on a third party link, You will be directed to 549 | that third party's site. We strongly advise You to review the Privacy 550 | Policy of every site You visit. 551 |
552 |553 | We have no control over and assume no responsibility for the content, 554 | privacy policies or practices of any third party sites or services. 555 |
556 |558 | We may update Our Privacy Policy from time to time. We will notify You 559 | of any changes by posting the new Privacy Policy on this page. 560 |
561 |562 | We will let You know via email and/or a prominent notice on Our 563 | Service, prior to the change becoming effective and update the 564 | "Last updated" date at the top of this Privacy Policy. 565 |
566 |567 | You are advised to review this Privacy Policy periodically for any 568 | changes. Changes to this Privacy Policy are effective when they are 569 | posted on this page. 570 |
571 |573 | If you have any questions about this Privacy Policy, You can contact 574 | us: 575 |
576 |