Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://media.hungama.com/c/4/c16/fe4/41239877/41239877_128.mp3?ahC6QJXp689q8mmwtI1ELFoexYmqQtotOrvWb7fX2zyyPw7w266n6CZ7BPpcRABPjBK8ivOlaHRSlCf82YbLzjCadP6mZo2TOPtx3ZkbBNCHg7VRAKNJ5VSvvfgHZISs7Jwzfg
- https://www.hungama.com/user/downloads
- content_id=2379437&content_type=song
- const nodeItems = document.getElementsByClassName('art-ttl');
- let iterTime = 0;
- const inter = 10000;
- for (a of nodeItems) {
- const href = a.getAttribute('href');
- if (href.includes('/song/')) {
- const contentId = /https:\/\/www.hungama.com.song\/([^/]+)\/([0-9]+)\//.exec(href)[2];
- console.log(`processing ${contentId}`);
- const formData = new FormData();
- formData.append('content_id', contentId);
- formData.append('content_type', 'song');
- setTimeout(() => {
- $.ajax({
- type: 'POST',
- url: '/user/downloads',
- data: `content_id=${contentId}&content_type=song`,
- processData: false,
- success: (data) => {
- console.log(data);
- const response = JSON.parse(data);
- if (response.stats === 'done') {
- console.log(`about to download ${response.file_path}`);
- window.open(response.file_path, '_blank');
- } else {
- console.log(`status not done for ${contentId}`);
- }
- }
- });
- }, iterTime * inter);
- iterTime++;
- }
- }
- for (a of nodeItems) {
- const href = a.getAttribute('href');
- if (href.includes('/song/')) {
- const contentId = /https:\/\/www.hungama.com.song\/([^/]+)\/([0-9]+)\//.exec(href)[2];
- console.log(`processing ${contentId}`);
- }
- }
- $.ajax({
- type: 'POST',
- url: '/user/downloads',
- data: `content_id=${contentId}&content_type=song`,
- processData: false,
- success: (data) => {
- console.log(data);
- }
- });
- $.post('/user/downloads', formData, (data) => {
- console.log(data);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement